[Bug tree-optimization/50576] New: Recent vector comparison changes cause an ICE

2011-09-30 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50576

 Bug #: 50576
   Summary: Recent vector comparison changes cause an ICE
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: artyom.shinkar...@gmail.com,
richard.guent...@gmail.com
  Host: x86_64-linux-gnu
Target: arm-none-eabi


Compiling the following (cut down from the
gcc.c-torture/execute/vector-compare-1.c test case):

/* try.c.  */
int
main (int argc, char *argv[])
{
  __attribute__ ((vector_size ((2) * sizeof (double double d0;
  __attribute__ ((vector_size ((2) * sizeof (double double d1;
  __attribute__ ((vector_size ((2) * sizeof (long long long long idres;
{
  idres = (d0 > d1);
}
}
/* end of try.c.  */

with:

arm-none-eabi-gcc -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 -c try.c

Gives:

try.c: In function 'main':
try.c:3:1: error: invalid vector comparison resulting type
vector(2) long long int
idres = d0 > d1;

try.c:3:1: internal compiler error: verify_gimple failed

This was tested with trunk r179378.  

The issue was introduced by this patch
(http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01088.html - checked in as
r179342), and has not been fixed by Richard Guenther's follow on patch
(http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01933.html).


[Bug tree-optimization/50576] Recent vector comparison changes cause an ICE

2011-09-30 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50576

--- Comment #2 from Matthew Gretton-Dann  
2011-09-30 10:58:03 UTC ---
(In reply to comment #1)
> is sizeof(long long) == sizeof (double)?

Yes - sizeof(long long) and sizeof(double) are both 8.


[Bug tree-optimization/50576] Recent vector comparison changes cause an ICE

2011-10-04 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50576

Matthew Gretton-Dann  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED

--- Comment #3 from Matthew Gretton-Dann  
2011-10-04 08:51:37 UTC ---
This has been fixed by the fixes for PR 50574


[Bug tree-optimization/50717] New: Silent code gen fault with incorrect widening of multiply

2011-10-13 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50717

 Bug #: 50717
   Summary: Silent code gen fault with incorrect widening of
multiply
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
  Host: x86_64-linux-gnu
Target: arm-none-eabi


Created attachment 25483
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25483
Executable test case.

The attached test case fails when compiled and executed as follows:

arm-none-eabi-gcc -O2 gen_exec.c -o gen_exec.axf -fno-expensive-optimizations
.../linaro-qemu/0.15.50/bin/qemu-arm  ./gen_exec.axf

The two functions in the test case f0a and f0b are identical, just compiled
with -fexpensive-optimizations off (for f0a) and on (for f0b).  The code
generation differences produce an incorrect result.

The attached file gen_exec_simple.c contains the individual f0b function for
compilation.

The attached tree dumps show the first difference between compiling
gen_exec_simple.c with and without -fexpensive-optimizations.  The main
difference seems to be the following:


--- gen_exec_simple.c.135t.tailc.cheap  2011-10-13 15:02:50.0 +0100
+++ gen_exec_simple.c.135t.tailc.expensive  2011-10-13 15:03:15.0
+0100
@@ -3,6 +3,7 @@

 f0b (uint32_t * restrict arg1, uint64_t * restrict arg2, uint8_t * restrict
arg3)
 {
+   D.8363;
   void * D.8362;
   sizetype D.8361;
   void * D.8360;
@@ -67,7 +68,8 @@ f0b (uint32_t * restrict arg1, uint64_t 
   D.8255_41 = MEM[base: D.8362_127, offset: 0B];
   D.8256_42 = D.8252_36 * D.8255_41;
   D.8257_43 = (uint64_t) D.8256_42;
-  D.8258_44 = D.8257_43 + temp_1_18;
+  D.8363_7 = () D.8245_16;
+  D.8258_44 = WIDEN_MULT_PLUS_EXPR ;
   D.8259_45 = D.8258_44 >> 1;
   D.8260_46 = D.8259_45 >> 24;
   D.8272_57 = D.8251_31 | 1;

That is a widening multiply/accumulate has been added to the tree.  This
ultimately becomes a UMLAL in the output.

This widening multiply/accumulate is incorrect.  It is trying to do the
following:

result += ((arg3[idx] * arg1[idx]) + temp_1)/2))>>24) / (temp_2 | 1));

Where arg3[idx] is a uint8_t, arg1[idx] is a uint32_t and temp_1 is a uint64_t.

As written in C, the result of the multiply is truncated to a 32-bit value, and
then added to the 64-bit value.

The widening multiply/accumulate, however, widens the inputs to 64-bits, and
does a 64-bit multiply before adding it to the 64-bit accumulator.

These produce a different result when the result of the multiply overflows
32-bits.

A bisect of the source leads me to believe that revision 177907 is responsible:
http://gcc.gnu.org/viewcvs?view=revision&revision=177907


[Bug tree-optimization/50717] Silent code gen fault with incorrect widening of multiply

2011-10-13 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50717

--- Comment #1 from Matthew Gretton-Dann  
2011-10-13 15:49:15 UTC ---
Created attachment 25484
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25484
Single function testcase (not executable)


[Bug tree-optimization/50717] Silent code gen fault with incorrect widening of multiply

2011-10-13 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50717

--- Comment #2 from Matthew Gretton-Dann  
2011-10-13 15:49:46 UTC ---
Created attachment 25485
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25485
Correct tree output


[Bug tree-optimization/50717] Silent code gen fault with incorrect widening of multiply

2011-10-13 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50717

--- Comment #3 from Matthew Gretton-Dann  
2011-10-13 15:50:48 UTC ---
Created attachment 25486
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25486
Incorrect tree output


[Bug tree-optimization/50727] New: ICE with segfault in flow_bb_inside_loop_p

2011-10-14 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50727

 Bug #: 50727
   Summary: ICE with segfault in flow_bb_inside_loop_p
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: i...@il.ibm.com
Target: arm-none-eabi


Created attachment 25496
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25496
Test case

The attached test case causes an ICE when compiled as follows:

$ arm-none-eabi-gcc -O3 -mfpu=neon -mcpu=cortex-a9 -ftree-vectorize test.c
test.c: In function 'f0a':
test.c:5:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

$ gdb --args  /work/builds/install/libexec/gcc/arm-none-eabi/4.7.0/cc1 -quiet
-v -D__USES_INITFINI__ test.c -quiet -dumpbase test.c -mfpu=neon
-mcpu=cortex-a9 -mfloat-abi=softfp -auxbase test -O3 -version -ftree-vectorize
-o /tmp/ccaMl5b6.s

Gives the following backtrace:

#0  flow_bb_inside_loop_p (loop=0x77ebff68, bb=0x0) at
/work/local-checkouts/gcc-fsf/gcc/cfgloop.c:776
#1  0x009f053f in vect_is_simple_use (operand=0x775fc910,
loop_vinfo=, bb_vinfo=0x0, def_stmt=0x7fffd438,
def=0x7fffd440, dt=0x7fffd44c)
at /work/local-checkouts/gcc-fsf/gcc/tree-vect-stmts.c:5611
#2  0x009fa2ac in process_use (stmt=0x775f4630, use=0x775fc910,
loop_vinfo=0x14ed400, live_p=,
relevant=vect_used_in_scope, worklist=)
at /work/local-checkouts/gcc-fsf/gcc/tree-vect-stmts.c:368
#3  0x009fadb7 in vect_mark_stmts_to_be_vectorized
(loop_vinfo=0x14ed400) at
/work/local-checkouts/gcc-fsf/gcc/tree-vect-stmts.c:674
#4  0x00a0cb61 in vect_analyze_loop_2 (loop=0x77ebff68) at
/work/local-checkouts/gcc-fsf/gcc/tree-vect-loop.c:1504
#5  vect_analyze_loop (loop=0x77ebff68) at
/work/local-checkouts/gcc-fsf/gcc/tree-vect-loop.c:1650
#6  0x00a19ece in vectorize_loops () at
/work/local-checkouts/gcc-fsf/gcc/tree-vectorizer.c:203
#7  0x007d81a9 in execute_one_pass (pass=0x129f780) at
/work/local-checkouts/gcc-fsf/gcc/passes.c:2064
#8  0x007d8525 in execute_pass_list (pass=0x129f780) at
/work/local-checkouts/gcc-fsf/gcc/passes.c:2119
#9  0x007d8537 in execute_pass_list (pass=0x129f5a0) at
/work/local-checkouts/gcc-fsf/gcc/passes.c:2120
#10 0x007d8537 in execute_pass_list (pass=0x129eca0) at
/work/local-checkouts/gcc-fsf/gcc/passes.c:2120
#11 0x008df618 in tree_rest_of_compilation (fndecl=0x77569600) at
/work/local-checkouts/gcc-fsf/gcc/tree-optimize.c:420
#12 0x005c0e5e in cgraph_expand_function (node=0x7759) at
/work/local-checkouts/gcc-fsf/gcc/cgraphunit.c:1805
#13 0x005c445a in cgraph_expand_all_functions () at
/work/local-checkouts/gcc-fsf/gcc/cgraphunit.c:1864
#14 cgraph_optimize () at /work/local-checkouts/gcc-fsf/gcc/cgraphunit.c:2141
#15 0x005c497a in cgraph_finalize_compilation_unit () at
/work/local-checkouts/gcc-fsf/gcc/cgraphunit.c:1312
#16 0x004a6e48 in c_write_global_declarations () at
/work/local-checkouts/gcc-fsf/gcc/c-decl.c:9936
#17 0x0087c61a in compile_file (argc=18, argv=0x7fffd8e8) at
/work/local-checkouts/gcc-fsf/gcc/toplev.c:581
#18 do_compile (argc=18, argv=0x7fffd8e8) at
/work/local-checkouts/gcc-fsf/gcc/toplev.c:1925
#19 toplev_main (argc=18, argv=0x7fffd8e8) at
/work/local-checkouts/gcc-fsf/gcc/toplev.c:2001
#20 0x77874c4d in __libc_start_main () from /lib/libc.so.6
#21 0x00496de9 in _start ()

The ICE happens at the same place as in PR50635 - however still occurs (in rev
179965) in a compiler with a fix for that PR.


[Bug tree-optimization/50729] New: Silent code gen fault: Value range propagation seems to propagate values across narrowing/widening

2011-10-14 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50729

 Bug #: 50729
   Summary: Silent code gen fault: Value range propagation seems
to propagate values across narrowing/widening
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
Target: arm*-*-*


Created attachment 25497
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25497
Executable test case.

The attached executable test rtest.c fails when compiled and executed as
follows:

$ arm-none-eabi-gcc rtest.c -O2 -o rtest.axf
$ ~ramrad01/public/qemu-arm rtest.axf 
1616
20019
FAIL!!

The test consists of two identical functions f0a and f0b which are compiled
with different optimization levels, and produce different results at -O0 and
-O2.

Investigations lead me to believe that VRP is at fault - initially because the
issue goes away if you compile -O2 -fdisable-tree-vrp1 -fdisable-tree-vrp2.

The attached cutdown testcase (rtest-cutdown.c) when compiled as follows
produces the attached tree dumps.

$ arm-none-eabi-gcc rtest-cutdown.c -O2 -o rtest.axf -fdump-tree-all

Looking at the difference between the two attached trees indicates that before
VRP1 the tree looked something like:

  int8_t temp_1;
  uint64_t D.6414;
  short unsigned int D.6416;
  temp_1_27 = (int8_t) D.6414_26;
  D.6416_33 = (short unsigned int) temp_1_27;

[note short unsigned int is 16-bits]

VRP1's analysis finds the following:

D.6414_26: [0, 4611686018427388031]
temp_1_27: VARYING

After VRP1 this bit of tree is transformed into:

  int8_t temp_1;
  uint64_t D.6414;
  short unsigned int D.6416;
  temp_1_27 = (int8_t) D.6414_26;
  D.6416_33 = (short unsigned int) D.6414_26;

That is D.6416_33 is now assigned directly from D.6414_26 instead of going
through temp_1_27.

[Similar replacements of temp_1_27 by D.6414_26 occur throughout the example
but this particular case serves its purpose].

This is incorrect as it stops the 64-bit value D6414_26 being narrowed to an
8-bit signed value before being widened to a 16-bit, now it just gets narrowed
from 64-bits to 16-bits.


[Bug tree-optimization/50729] Silent code gen fault: Value range propagation seems to propagate values across narrowing/widening

2011-10-14 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50729

--- Comment #1 from Matthew Gretton-Dann  
2011-10-14 13:40:14 UTC ---
Created attachment 25498
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25498
Cutdown pre-processed non-executable testcase


[Bug tree-optimization/50729] Silent code gen fault: Value range propagation seems to propagate values across narrowing/widening

2011-10-14 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50729

--- Comment #2 from Matthew Gretton-Dann  
2011-10-14 13:49:15 UTC ---
Created attachment 25499
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25499
Tree just before VRP


[Bug tree-optimization/50729] Silent code gen fault: Value range propagation seems to propagate values across narrowing/widening

2011-10-14 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50729

--- Comment #3 from Matthew Gretton-Dann  
2011-10-14 13:49:50 UTC ---
Created attachment 25500
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25500
VRP1 Analysis and resultant tree


[Bug tree-optimization/50873] New: The fix to PR50730 causes gcc.c-torture/unsorted/dilayout.c to ICE

2011-10-26 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50873

 Bug #: 50873
   Summary: The fix to PR50730 causes
gcc.c-torture/unsorted/dilayout.c to ICE
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: i...@il.ibm.com
Target: arm*-*-*


The fix to PR50730 (revision 180367 -
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180367) causes the test
gcc.c-torture/unsorted/dilayout.c to ICE at -O3.

A reduced test case is:

$ cat test.c
/* arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=soft -O3 test.c  */
struct ii
{
  int a;
  int b;
};
struct foo
{
  int a;
  struct ii ab;
};
struct ii
foo (int *p, struct foo a)
{
  p[0] = a.a;
  p[1] = a.ab.a;
}
/* end of test.c.  */
$ arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=soft -O3 test.c
test.c: In function 'foo':
test.c:15:11: internal compiler error: in expand_insn, at optabs.c:7693

-fno-tree-vectorize causes the issue to go away.

The issue still exists in revision 180524


[Bug tree-optimization/50873] The fix to PR50730 causes gcc.c-torture/unsorted/dilayout.c to ICE

2011-10-27 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50873

--- Comment #2 from Matthew Gretton-Dann  
2011-10-27 13:31:27 UTC ---
(In reply to comment #1)
> I see this too, but I don't think it's my patch's fault. I reverted it and the
> reduced test still failed. The patch makes no difference for this basic block 
> -
> it gets vectorized with or without it.

Apologies if I've miss labelled this issue - git bisect suggested that r180367
was where the issue was introduced.  I will take another look this afternoon to
see if I misread the output and it was another check-in nearby.


[Bug target/50978] New: libgcc build fails - unable to find unwind-arm-common.h

2011-11-03 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50978

 Bug #: 50978
   Summary: libgcc build fails - unable to find
unwind-arm-common.h
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: ramana.radhakrish...@arm.com, rearn...@.arm.com,
r...@gcc.gnu.org
Target: arm-none-eabi


Current SVN fails to build libgcc for an arm-none-eabi target because it can't
find unwind-arm-common.h:

In file included from
/work/upstream-checkouts/gcc/libgcc/config/arm/unwind-arm.c:24:0:
./unwind.h:31:31: fatal error: unwind-arm-common.h: No such file or directory
compilation terminated.


I think that the recent move of source from gcc/config to libgcc/config failed
to move the EXTRA_HEADERS line from gcc/config/arm/t-bpabi and
gcc/config/arm/t-symbian to libgcc/config/arm/t-bpabi and
libgcc/config/arm/t-symbian respectively.

However, making the naive change doesn't work as unwind-arm-common.h lives in
gcc/ginclude.  Does the header have to move directory?

GCC is configured as follows:

/work/upstream-checkouts/gcc/configure --target=arm-master-eabi
--prefix=/work/builds/install
--with-sysroot=/work/builds/install/arm-master-eabi --with-newlib --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --with-gmp=.../linux_x86_64
--with-mpfr=.../linux_x86_64 --with-mpc=.../linux_x86_64
--with-libelf=.../linux_x86_64 --disable-lto --disable-shared --disable-nls
--disable-threads --disable-tls --enable-checking=yes --with-cpu=cortex-a9
--with-fpu=neon --with-float=softfp 

Checked against gcc trunk SVN revision 180820


[Bug target/50978] libgcc build fails - unable to find unwind-arm-common.h

2011-11-03 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50978

--- Comment #2 from Matthew Gretton-Dann  
2011-11-03 15:45:57 UTC ---
(In reply to comment #1)
> > Current SVN fails to build libgcc for an arm-none-eabi target because it 
> > can't
> > find unwind-arm-common.h:
> >
> > In file included from
> > /work/upstream-checkouts/gcc/libgcc/config/arm/unwind-arm.c:24:0:
> > ./unwind.h:31:31: fatal error: unwind-arm-common.h: No such file or 
> > directory
> > compilation terminated.
> 
> Could you please provide the complete failing command line?  Thanks.

/work/builds/arm-master-eabi/gcc2/./gcc/xgcc
-B/work/builds/arm-master-eabi/gcc2/./gcc/
-B/work/builds/install/arm-master-eabi/bin/
-B/work/builds/install/arm-master-eabi/lib/ -isystem
/work/builds/install/arm-master-eabi/include -isystem
/work/builds/install/arm-master-eabi/sys-include-g -O2 -mthumb -O2  -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include  -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc -fno-inline -I. -I. -I../../.././gcc
-I/work/upstream-checkouts/gcc/libgcc -I/work/upstream-checkouts/gcc/libgcc/.
-I/work/upstream-checkouts/gcc/libgcc/../gcc
-I/work/upstream-checkouts/gcc/libgcc/../include-o unwind-arm.o -MT
unwind-arm.o -MD -MP -MF unwind-arm.dep -fexceptions -c
/work/upstream-checkouts/gcc/libgcc/config/arm/unwind-arm.c 

GCC configured as:


/work/upstream-checkouts/gcc/configure --target=arm-master-eabi
--prefix=/work/builds/install
--with-sysroot=/work/builds/install/arm-master-eabi --with-newlib --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --with-gmp=.../linux_x86_64
--with-mpfr=.../linux_x86_64 --with-mpc=.../linux_x86_64
--with-libelf=.../linux_x86_64 --disable-lto --disable-shared --disable-nls
--disable-threads --disable-tls --enable-checking=yes --with-cpu=cortex-a9
--with-fpu=neon --with-float=softfp 

Build directory: /work/builds/arm-master-eabi/gcc2


[Bug target/50978] libgcc build fails - unable to find unwind-arm-common.h

2011-11-03 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50978

--- Comment #5 from Matthew Gretton-Dann  
2011-11-03 16:43:41 UTC ---
(In reply to comment #3)
> I think I found it: an incredibly stupid error.  The contents of arm/t-bpabi
> was moved to libgcc, with the exception of EXTRA_HEADERS.  I missed that and
> removed the file.  Please try the attached patch.

After applying the patch I have managed a successful build.

Thanks,

Matt


[Bug tree-optimization/51301] New: Compiler ICE in vect_is_simple_use_1

2011-11-25 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51301

 Bug #: 51301
   Summary: Compiler ICE in vect_is_simple_use_1
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: i...@gcc.gnu.org
Target: arm*-*-*


Compiling the following test results in an ICE:

$ cat test.c
/* arm-systest-eabi-gcc -c -O3 -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
test.c  */
typedef signed char int8_t;
typedef signed long long int64_t;
int64_t
f0a (int8_t * __restrict__ arg1)
{
  int idx;
  int64_t result = 0;
  for (idx = 0; idx < 416; idx += 1)
result += arg1[idx] << (arg1[idx] == arg1[idx]);
  return result;
}
/* End of test.c.  */
$ arm-upstream-eabi-gcc -c test.c -O3
test.c: In function 'f0a':
test.c:5:1: internal compiler error: in vect_is_simple_use_1, at
tree-vect-stmts.c:5970
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Tested against gcc trunk, rev 181718


[Bug tree-optimization/51799] New: Compiler ICE in vect_is_simple_use_1

2012-01-09 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51799

 Bug #: 51799
   Summary: Compiler ICE in vect_is_simple_use_1
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
Target: arm-*-*


Created attachment 26281
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26281
Failing test case.

The attached test case causes the compiler to ICE as follows:

$ arm-none-eabi-gcc  -O1 -ftree-vectorize -mcpu=cortex-a9 \
  -mfpu=neon -mfloat-abi=softfp ice.c 
ice.c: In function 'f0a':
ice.c:7:1: internal compiler error: in vect_is_simple_use_1, at
tree-vect-stmts.c:5987
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

Checked against trunk revision 183018.


[Bug tree-optimization/51799] [4.7 Regression] Compiler ICE in vect_is_simple_use_1

2012-01-10 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51799

Matthew Gretton-Dann  changed:

   What|Removed |Added

  Known to work||4.6.2
Summary|Compiler ICE in |[4.7 Regression] Compiler
   |vect_is_simple_use_1|ICE in vect_is_simple_use_1
  Known to fail||4.7.0

--- Comment #2 from Matthew Gretton-Dann  
2012-01-10 13:27:39 UTC ---
Doesn't ICE with GCC 4.6.2.


[Bug target/50946] ICE on armhf with webkitgtk+

2012-01-18 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50946

Matthew Gretton-Dann  changed:

   What|Removed |Added

 CC||mgretton at sourceware dot
   ||org

--- Comment #3 from Matthew Gretton-Dann  
2012-01-18 13:57:12 UTC ---
I can reproduce this for GCC 4.6.2 (rev 183061) with an bare-metal target
(arm-none-eabi):c

arm-none-eabi-g++ -O2 -mfpu=vfpv3 -mfloat-abi=hard -march=armv7-a -mthumb
-fpermissive -w -c webkit_testcase-min.i 

Current trunk does not ICE on the test case.


[Bug target/56184] New: Internal compiler error in push_reload during bootstrap stage 2

2013-02-02 Thread mgretton at sourceware dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56184



 Bug #: 56184

   Summary: Internal compiler error in push_reload during

bootstrap stage 2

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: target

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: mgret...@sourceware.org





Created attachment 29337

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29337

Reduced test case



When bootstrapping on an ARM target I get the following error:



/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/./prev-gcc/xg++

-B/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/./prev-gcc/

-B/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/install/arm-linux-gnueabi/bin/

-nostdinc++

-B/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/src/.libs

-B/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/libsupc++/.libs

-I/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/include/arm-linux-gnueabi

-I/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/include

-I/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/gcc-4.8~svn195568/libstdc++-v3/libsupc++

-L/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/src/.libs

-L/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/build/prev-arm-linux-gnueabi/libstdc++-v3/libsupc++/.libs

-c   -g -O2 -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti

-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings

-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long

-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common 

-DHAVE_CONFIG_H -I. -I. -I../../../gcc-4.8~svn195568/gcc

-I../../../gcc-4.8~svn195568/gcc/. -I../../../gcc-4.8~svn195568/gcc/../include

-I../../../gcc-4.8~svn195568/gcc/../libcpp/include 

-I../../../gcc-4.8~svn195568/gcc/../libdecnumber

-I../../../gcc-4.8~svn195568/gcc/../libdecnumber/dpd -I../libdecnumber

-I../../../gcc-4.8~svn195568/gcc/../libbacktrace   

../../../gcc-4.8~svn195568/gcc/lto-streamer-out.c -o lto-streamer-out.o

../../../gcc-4.8~svn195568/gcc/lto-streamer-in.c: In function 'void

lto_input_function_body(lto_file_decl_data*, tree, const char*)':

../../../gcc-4.8~svn195568/gcc/lto-streamer-in.c:1003:1: internal compiler

error: in push_reload, at reload.c:1014

 }

 ^

0x6d1a41 push_reload(rtx_def*, rtx_def*, rtx_def**, rtx_def**, reg_class,

machine_mode, machine_mode, int, int, int, reload_type)

../../../gcc-4.8~svn195568/gcc/reload.c:1012

0x6daa8d find_reloads(rtx_def*, int, int, int, short*)

../../../gcc-4.8~svn195568/gcc/reload.c:4099

0x6e6d8b calculate_needs_all_insns

../../../gcc-4.8~svn195568/gcc/reload1.c:1520

0x6e560b reload(rtx_def*, int)

../../../gcc-4.8~svn195568/gcc/reload1.c:941

0x5f1843 do_reload

../../../gcc-4.8~svn195568/gcc/ira.c:4635

0x5f1a33 rest_of_handle_reload

../../../gcc-4.8~svn195568/gcc/ira.c:4736

Please submit a full bug report,

with preprocessed source if appropriate.

Please include the complete backtrace with any bug report.

See  for instructions.

make[7]: *** [lto-streamer-in.o] Error 1





GCC has been configured as follows:



--prefix=/cbuild/slaves/tcpandas/gcc-4.8~svn195568/gcc/default/install

--enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-linker-build-id

--with-mode=thumb --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=neon

--with-float=softfp --build=arm-linux-gnueabi





Attached test case is a reduced version which triggers the same problem with a

cross-compiler configured as:



Configured with: /work/sources/gcc-fsf/master/configure

--target=arm-none-linux-gnueabi --prefix=/work/builds/gcc-fsf-master/tools

--with-sysroot=/work/builds/gcc-fsf-master/sysroot-arm-none-linux-gnueabi

--disable-libssp --disable-libgomp --disable-libmudflap

--enable-languages=c,c++ --with-arch=armv7-a --with-fpu=vfpv3-d16

--with-float=softfp --with-thumb



Attached test case invoked by:



.../arm-none-linux-gnueabi-g++  -c-O2 -mthumb -march=armv7-a -mfpu=neon

-mfloat-abi=softfp -mtune=cortex-a9 test.ii



Bisecting suggests the issue was introduced by subversion revision 194558:



2012-12-17  Andrew Stubbs  

Ulrich Weigand  



gcc/

* config/arm/arm.md (zero_extenddi2): Add extra alternatives

for NEON registers.

Add alternative for one-instruction extend-in-place.

(extenddi2): Likewise.

Add constraints for Thumb-mode memory loads.

Prevent extend splitters doing NEON alternatives.

* config/arm/iterators.md (qhs_extenddi_cstr, qhs_zextenddi_cstr):

Adjust constraints to a

[Bug target/48061] New: Internal compiler error in spill_failure

2011-03-10 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48061

   Summary: Internal compiler error in spill_failure
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: mgret...@sourceware.org
CC: ramana.radhakrish...@arm.com
Target: arm-none-eabi


Created attachment 23615
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23615
Test case for bug

Compiling the attached test case (based on
gcc/testsuite/gcc.dg/torture/pr47975.c) produces an internal compiler error in
spill_failure.

arm-eabi-gcc -O2 -mfloat-abi=hard -mcpu=cortex-a9 -mfpu=neon test.i produces:

test.c: In function 'foo':
test.c:7:1: error: unable to find a register to spill in class 'GENERAL_REGS'
test.c:7:1: error: this is the insn:
(insn 18 5 6 2 (set (reg:OI 154)
(const_int 0 [0])) test.c:6 751 {*neon_movoi}
 (expr_list:REG_EQUAL (const_int 0 [0])
(nil)))
test.c:7:1: internal compiler error: in spill_failure, at reload1.c:2105
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

arm-eabi-gcc -v produces the following output:
Using built-in specs.
COLLECT_GCC=.../bin/arm-eabi-gcc
COLLECT_LTO_WRAPPER=.../bin/../libexec/gcc/arm-eabi/4.6.0/lto-wrapper
Target: arm-eabi
Configured with: .../configure --target=arm-eabi --enable-checking=release
--disable-gdbtk --disable-werror --disable-tui --disable-rda --disable-sid
--disable-utils --disable-lto --with-cpu=cortex-a9 --with-float=softfp
--with-fpu=neon --disable-lto --disable-werror --disable-shared --disable-nls
--disable-threads --disable-tls --enable-checking=yes
--enable-languages=c,c++,fortran --with-newlib
Thread model: single
gcc version 4.6.0 20110309 (experimental) (GCC)


[Bug target/48061] Internal compiler error in spill_failure

2011-03-10 Thread mgretton at sourceware dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48061

Matthew Gretton-Dann  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #1 from Matthew Gretton-Dann  
2011-03-10 15:06:58 UTC ---
Also occurs with -mfloat-abi=softfp