This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix PR 7705


This fixes PR 7705, 7720, 7339: compiler crash when compiling
(n>>32)&255. The crash is in simplify_subreg; it's objecting
to an invalid subreg. This simply prevents the invalid subreg
from being generated. Bootstrapped and tested on Darwin.
(Personally I'm not sure accepting this code is better
than crashing, since it frequently won't do what the user
expects, whatever that might be. Is there any support for
making "shift by >= word size" an error?)

2002-09-19 Dale Johannesen <dalej@apple.com>
* combine.c (make_extraction): Don't create
invalid subreg.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.313
diff -u -d -b -w -c -3 -p -r1.313 combine.c
cvs server: conflicting specifications of output style
*** combine.c 8 Sep 2002 18:07:54 -0000 1.313
--- combine.c 19 Sep 2002 16:58:52 -0000
*************** make_extraction (mode, inner, pos, pos_r
*** 6124,6129 ****
--- 6124,6134 ----
final_word += (GET_MODE_SIZE (inner_mode)
- GET_MODE_SIZE (tmode)) % UNITS_PER_WORD;

+ /* Avoid creating invalid subregs, for example when
+ simplifying (x>>32)&255. */
+ if (final_word >= GET_MODE_SIZE (inner_mode))
+ return NULL_RTX;
+
new = gen_rtx_SUBREG (tmode, inner, final_word);
}
else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]