Works on avr-gcc (GCC) 4.2.2 (WinAVR 20071221). Does not on 4.4 HEAD.
Test results posts show this test failing since AT LEAST SVN rev 132993 on AVR
(March 3 2008) (before that test was not run - so dont know when it started.
gcc-c/toture/unsorted/shm.c
foo (int *p)
{
int a = *p;
return a >> 24;
}
/home/hutchia/Desktop/gcc/gcc/testsuite/gcc.c-torture/unsorted/shm.c:5:
internal compiler error: in simplify_subreg, at simplify-rtx.c:4962
test.c: In function 'foo':
test.c:4: warning: right shift count >= width of type
Analyzing compilation unit
Performing interprocedural optimizations
<visibility> <early_local_cleanups> <summary generate> <inline> <static-var>
<p
ure-const>Assembling functions:
foo
Breakpoint 1, fancy_abort (file=0xb030f2 "../../gcc/gcc/simplify-rtx.c",
line=4962, function=0xb03158 "simplify_subreg")
at ../../gcc/gcc/diagnostic.c:654
654 internal_error ("in %s, at %s:%d", function, trim_filename (file),
lin
e);
(gdb) where
#0 fancy_abort (file=0xb030f2 "../../gcc/gcc/simplify-rtx.c", line=4962,
function=0xb03158 "simplify_subreg") at ../../gcc/gcc/diagnostic.c:654
#1 0x007a1143 in simplify_subreg (outermode=QImode, op=0x7ff24f20,
innermode=HImode, byte=3) at ../../gcc/gcc/simplify-rtx.c:4937
#2 0x007a1672 in simplify_gen_subreg (outermode=QImode, op=0x7ff24f20,
innermode=HImode, byte=3) at ../../gcc/gcc/simplify-rtx.c:5287
#3 0x007a0b83 in simplify_subreg (outermode=QImode, op=0x7ff25100,
innermode=HImode, byte=0) at ../../gcc/gcc/simplify-rtx.c:5271
#4 0x007a1672 in simplify_gen_subreg (outermode=QImode, op=0x7ff25100,
innermode=HImode, byte=0) at ../../gcc/gcc/simplify-rtx.c:5287
#5 0x0098f86a in propagate_rtx_1 (px=0x22caf4, old=0x4, new=0x7ff25100,
flags=2) at ../../gcc/gcc/fwprop.c:333
#6 0x009907da in forward_propagate_into (use=0x0)
at ../../gcc/gcc/fwprop.c:457
#7 0x00990bc2 in fwprop () at ../../gcc/gcc/fwprop.c:1055
#8 0x00624a0e in execute_one_pass (pass=0x0) at ../../gcc/gcc/passes.c:1292
#9 0x00624b33 in execute_pass_list (pass=0xa8c320)
at ../../gcc/gcc/passes.c:1342
#10 0x00624b46 in execute_pass_list (pass=0xa8c5c0)
at ../../gcc/gcc/passes.c:1343
#11 0x0084d899 in tree_rest_of_compilation (fndecl=0x7fdbf1f0)
at ../../gcc/gcc/tree-optimize.c:421
#12 0x00625d4b in cgraph_expand_function (node=0x7ff40280)
at ../../gcc/gcc/cgraphunit.c:1148
#13 0x0062793e in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1211
#14 0x0041bee7 in c_write_global_declarations ()
at ../../gcc/gcc/c-decl.c:8062
#15 0x0062c95b in toplev_main (argc=3, argv=0x1c014c0)
at ../../gcc/gcc/toplev.c:976
#16 0x0049467a in main (argc=3, argv=0x1c014c0) at ../../gcc/gcc/main.c:35
--
Summary: simplify_subreg ICE with right shift more than length
type AVR
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hutchinsonandy at aim dot com
GCC build triplet: i686-pc-cygwin
GCC host triplet: i686-pc-cygwin
GCC target triplet: avr-unknown-none
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36447