[committed] Fix GIMPLE error in gcc.dg/tree-ssa/cunroll-13.c for 16-bit int

Message ID 97a12774-5d1b-3369-678d-63f3b2e8c165@mittosystems.com
State New
Headers show
Series
  • [committed] Fix GIMPLE error in gcc.dg/tree-ssa/cunroll-13.c for 16-bit int
Related show

Commit Message

Jozef Lawrynowicz Nov. 1, 2018, 5:05 p.m.
The test fails for msp430-elf which has 16-bit int by default. The test
uses __INT32_TYPE__ in place of int, when __SIZEOF_INT__ < 4.

gcc.dg/tree-ssa/cunroll-13.c: In function 't':
gcc.dg/tree-ssa/cunroll-13.c:13:1: error: type mismatch in binary expression
    13 | t (struct a * a)
       | ^
long int

long int

int

_1 = _2 + 1;
during GIMPLE pass: omplower
gcc.dg/tree-ssa/cunroll-13.c:13:1: internal compiler error: verify_gimple failed
0xba82fd verify_gimple_in_seq(gimple*)
         ../../gcc/tree-cfg.c:5082
0xa9d690 execute_function_todo
         ../../gcc/passes.c:1927
0xa9df29 execute_todo
         ../../gcc/passes.c:1979

There is a missing cast when the integer literal "1" is used, which causes the
above error. Committed the attached patch as "obvious".

Patch

2018-11-01  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

gcc/testsuite

       * gcc.dg/tree-ssa/cunroll-13.c: Add missing cast from literal to int32.

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
index baac6b4..096380a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-13.c
@@ -29,7 +29,7 @@  bb_3:
   return;
 
 bb_4:
-  _1 = _2 + 1;
+  _1 = _2 + _Literal (i32) 1;
   a_6(D)->a[i_19] = _1;
   i_8 = i_19 + _Literal (i32) 1;
   if (i_8 <= _Literal (i32) 123455)