Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot apply GCC patch because of weird character in source
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
xgivolari
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2021
Posts: 102

PostPosted: Sun Jan 09, 2022 11:20 am    Post subject: Cannot apply GCC patch because of weird character in source Reply with quote

Hello everyone,

I have a patch for gcc that looks like this:
Code:
@@ -10532,19 +10494,6 @@
     ix86_expand_xorsign (operands);
   DONE;
 })
-
-(define_insn_and_split "@xorsign<mode>3_1"
-  [(set (match_operand:MODEF 0 "register_operand" "=&Yv")
-   (unspec:MODEF
-     [(match_operand:MODEF 1 "register_operand" "Yv")
-      (match_operand:MODEF 2 "register_operand" "0")
-      (match_operand:<ssevecmode> 3 "nonimmediate_operand" "Yvm")]
-     UNSPEC_XORSIGN))]
-  "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_xorsign (operands); DONE;")
 
 ;; One complement instructions



Right above the "One compliment instructions" line, there is a weird character that is not even rendered at all by Gentoo's forum software. You can see it here. It is definitely present in the original source code as well, as can be seen here. (just search for "One compliment instructions") The problem is that this thing prevents the above patch from applying. I have tested this on multiple devices and operating systems, but it looks the same everywhere. Does anyone know how I can fix this? Thanks.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3925

PostPosted: Sun Jan 09, 2022 2:40 pm    Post subject: Reply with quote

Code:

@@ -10532,19 +10494,6 @@
     ix86_expand_xorsign (operands);
   DONE;
 })
-
-(define_insn_and_split "@xorsign<mode>3_1"
-  [(set (match_operand:MODEF 0 "register_operand" "=&Yv")
-   (unspec:MODEF
-     [(match_operand:MODEF 1 "register_operand" "Yv")
-      (match_operand:MODEF 2 "register_operand" "0")
-      (match_operand:<ssevecmode> 3 "nonimmediate_operand" "Yvm")]
-     UNSPEC_XORSIGN))]
-  "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_xorsign (operands); DONE;")
 
 ;; One complement instructions


Try with the above
I used
Code:

sed $'s/[^[:print:]\t]//g'

to remove any stupid little hidden characters.
What does this patch do?
Are you applying it the correct way ie via /etc/portage/patches directory?
I see its from clearlinux.
_________________
:)
Back to top
View user's profile Send private message
larrys
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2020
Posts: 81
Location: New Jersey

PostPosted: Sun Jan 09, 2022 3:05 pm    Post subject: Reply with quote

xgivolari,
That looks like a form feed: ascii
Code:
014   12    0C    FF  '\f' (form feed)

That's very common in the gcc code base. I count 1168 files in the gcc-11.2.0 code base. Since it was common, and since it's ascii, I would be surprised if patch could not handle it.

I tried testing your patch on the gcc-11.2.0 source file and was able to replicate your failure. But instead of the trailing context (where the form feed is), I see a difference in the leading context:
Code:
  "ix86_expand_xorsign (operands); DONE;")

(define_insn_and_split "@xorsign<mode>3_1"


I also tried it on the sample file you provided, but that had many failures.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54615
Location: 56N 3W

PostPosted: Sun Jan 09, 2022 3:14 pm    Post subject: Reply with quote

xgivolari,

That patch already seems to have been applied as the lines prefixed with a "-" have been removed from the source that you linked.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum