[Bug c/45687] New: possible wrong code bug

2010-09-15 Thread regehr at cs dot utah dot edu
I don't think there's anything wrong with the testcase.  The -O2 result is
wrong.

[reg...@gamow ~]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r164319-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r164319-install
--program-prefix=r164319- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100915 (experimental) (GCC) 

[reg...@gamow ~]$ current-gcc -O1 small.c -o small
[reg...@gamow ~]$ ./small 
1
[reg...@gamow ~]$ current-gcc -O2 small.c -o small
[reg...@gamow ~]$ ./small 
0
[reg...@gamow ~]$ cat small.c

int printf(const char *format, ...);

static int g_7;
static int *volatile g_6 = &g_7;

static int func_53(int *p_58)
{
return *p_58;
}

int main(void)
{
*g_6 = 1;
printf("%d\n", func_53(&g_7));
return 0;
}


-- 
   Summary: possible wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/45512] null pointer dereference in gcc

2010-09-03 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2010-09-03 14:20 ---
No crash from r163817, thanks!


-- 

regehr at cs dot utah dot edu changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WORKSFORME


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



[Bug c/45512] New: null pointer dereference in gcc

2010-09-02 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp426]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r163740-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r163740-install
--program-prefix=r163740- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100901 (experimental) (GCC) 

[reg...@gamow tmp426]$ cat small.c

int g_9;
int *g_8 = &g_9;
int g_56;
int *g_209 = &g_56;

int func_103 (int p_104)
{
  if (1 != *g_8)
{
  unsigned char l_107[3];
  g_56 &= l_107[2];
}
  else
for (0; g_56; 0)
  &p_104;
  return p_104;
}

void func_85 (int,int);

void int320 (int * p_51, int p_52, unsigned p_53)
{
  int l;
  func_85 (func_103 (0), *g_209);
  l = func_103 (0);
}

[reg...@gamow tmp426]$ current-gcc -O2 small.c

small.c: In function 'func_103':
small.c:6:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
   Summary: null pointer dereference in gcc
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/45059] New: error: invalid operands in binary operation, leads to ICE: verify_stmts failed

2010-07-24 Thread regehr at cs dot utah dot edu
[reg...@bethe tmp604]$ current-gcc -O3 small.c -c -fwhole-program
small.c: In function 'main':
small.c:42:1: error: invalid operands in binary operation
D.2852_11 = (unsigned int) D.2845_7 != 4294967295;

small.c:42:1: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@bethe tmp604]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r162424-inst
all/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/re
gehr/z/compiler-install/gcc-r162424-install --program-prefix=r162424-
--enable-langua
ges=c,c++
Thread model: posix
gcc version 4.6.0 20100722 (experimental) (GCC)

[reg...@bethe tmp604]$ cat small.c

typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;

static uint32_t
safe_mod_func_uint32_t_u_u (uint32_t ui1, uint8_t ui2)
{
  return ui2 ? ui1 : ui1 + ui2;
}

int8_t g_2;
uint32_t g_36[7][4] = {
  -1L, -1L, -1L, 0, -1L, -1L, -1L, 0
};

uint8_t g_56;
uint8_t g_269;
int32_t func_37 (const int16_t p_38, int16_t p_39, int8_t p_40, int32_t p_41,
 uint8_t p_42);
uint8_t
func_1 (void)
{
  uint8_t *l_298 = &g_2;
  func_20 (l_298,
   &l_298 != &l_298 == ~func_37 (func_37 (g_56, 0, 0, g_269, 0), 1, 0,
 -1L, 0), 0);
  return 0;
}

int32_t
func_37 (const int16_t p_38, int16_t p_39, int8_t p_40, int32_t p_41,
 uint8_t p_42)
{
  uint8_t *l_55 = &g_56;
  *l_55 |= g_2 < safe_mod_func_uint32_t_u_u (g_36[1][2], 0) | 0, ~p_39;
  return 0;
}

int
main (int argc, char *argv[])
{
  func_1 ();
}


-- 
   Summary: error: invalid operands in binary operation, leads to
ICE: verify_stmts failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44977] New: ice in propagate_rhs_into_lhs, at tree-ssa-dom.c:2728

2010-07-17 Thread regehr at cs dot utah dot edu
[reg...@bethe tmp603]$ current-gcc -O2 small.c -c
small.c: In function 'int329':
small.c:31:38: warning: assignment makes integer from pointer without a cast
[enabled by default]
small.c:24:5: internal compiler error: in propagate_rhs_into_lhs, at
tree-ssa-dom.c:2728
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@bethe tmp603]$ cat small.c

static unsigned short
foo (unsigned short ui1, unsigned short ui2)
{
  return ui1 - ui2;
}

static unsigned short
bar (unsigned ui1, unsigned short ui2)
{
  return ui1 + ui2;
}

struct S1
{
  const short f3;
};
int g_31;
short g_67;
struct S1 g_68[2][5][9][1][1] = {
};

int func_90 (int);

int int329 (int * const *const int32p_81, short ** p_82)
{
  short l_169[8];
  for (g_31 = 0; g_31 <= 0; g_31 = foo (g_31, 1))
{
  short l_85;
lbl_89:g_67 ^= l_85;
  for (l_85 = 0; l_85 >= 0; l_85 = bar)
if (g_31)
  goto lbl_89;
  func_90 (1), g_68[0][2][2][0][0].f3, 0;
}
  return l_169[6];
}

[reg...@bethe tmp603]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r162241-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r162241-install
--program-prefix=r162241- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100716 (experimental) (GCC)


-- 
   Summary: ice in propagate_rhs_into_lhs, at tree-ssa-dom.c:2728
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44937] New: crash due to null pointer deref

2010-07-14 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp420]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r162143-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r162143-install
--program-prefix=r162143- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100713 (experimental) (GCC) 

[reg...@gamow tmp420]$ valgrind -q --trace-children=yes current-gcc -O2 small.c 
-w

==30337== Invalid read of size 2
==30337==at 0x697485: walk_stmt_load_store_addr_ops (gimple.c:4776)
==30337==by 0x9B3512: rebuild_cgraph_edges (cgraphbuild.c:471)
==30337==by 0x72D5CD: execute_one_pass (passes.c:1565)
==30337==by 0x72D864: execute_pass_list (passes.c:1620)
==30337==by 0x72CACB: do_per_function_toporder (passes.c:1158)
==30337==by 0x72DC85: execute_ipa_pass_list (passes.c:1920)
==30337==by 0x9B8BF0: cgraph_optimize (cgraphunit.c:1851)
==30337==by 0x9B8E4A: cgraph_finalize_compilation_unit (cgraphunit.c:1171)
==30337==by 0x4A7C32: c_write_global_declarations (c-decl.c:9698)
==30337==by 0x7CED29: toplev_main (toplev.c:990)
==30337==by 0x5935ABC: (below main) (libc-start.c:220)
==30337==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==30337== 
small.c: In function 'func_4':
small.c:29:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp420]$ cat small.c

int g_19;
int *g_42;
int **volatile g = &g_42;
int g_67[5][9][2][1] = {
};

int
func_4 (int p_5, unsigned char p_6, unsigned char p_7)
{
  unsigned char l_8[1];
  if (p_6)
goto lbl_13;
  for (p_6 = 0; p_6; p_6 = (p_6, 0))
if (0)
  {
  }
else
lbl_13:for (p_6 = 0; p_6 < 1; p_6 += 1)
l_8[p_6] = 0;
  return 0;
}

int *
func_45 (unsigned long p_46, unsigned char p_47)
{
  int *l_56 = &g_19;
  &l_56 != &g | !1 == func_4 (0, g_67[2][6][1][0], 0) ^ func_4 (1, 0, 0);
  return 0;
}


-- 
   Summary: crash due to null pointer deref
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44858] New: likely integer wrong code bug

2010-07-07 Thread regehr at cs dot utah dot edu
reg...@john-home:~$ current-gcc -O0 small.c -o small
reg...@john-home:~$ ./small
checksum g_610 = 1
reg...@john-home:~$ current-gcc -O1 small.c -o small
reg...@john-home:~$ ./small
checksum g_610 = 0
reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161813-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161813-install
--program-prefix=r161813- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100704 (experimental) (GCC) 
reg...@john-home:~$ cat small.c
extern int printf (__const char *__restrict __format, ...);

int g_33 = 3;
int g_610 = 1;

long long foo(int i1, int i2)
{
return (i1 / i2);
}

int main(void)
{
int l_2 = 2;
l_2 &= foo(1, g_610) > g_610;
g_610 = (g_33 != 0) | l_2;
printf("checksum g_610 = %d\n", g_610);
return l_2;
}


-- 
   Summary: likely integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/44828] [4.3/4.4/4.5 Regression] possible integer wrong code bug

2010-07-06 Thread regehr at cs dot utah dot edu


--- Comment #6 from regehr at cs dot utah dot edu  2010-07-06 14:10 ---
(In reply to comment #2)
> Not sure whether the testcase is valid or not.  The multiplication using char
> variables on both sides (and likewise for result) is: -54 * -56 (= 3024),
> but (char) 3024 is -48.  For int that would be clear undefined behavior, but
> for char the multiplication is promoted to int, so it is (char) (int * int).

My students and I had to argue about this and read the standard before
submitting this bug report.  But I'm almost certain the testcase is valid.


-- 


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



[Bug c/44828] New: possible integer wrong code bug

2010-07-05 Thread regehr at cs dot utah dot edu
reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161813-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161813-install
--program-prefix=r161813- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100704 (experimental) (GCC) 

reg...@john-home:~$ current-gcc -O1 small.c -o small
reg...@john-home:~$ ./small
checksum g_40 = 274686410
reg...@john-home:~$ current-gcc -O2 small.c -o small
reg...@john-home:~$ ./small
checksum g_40 = -1

reg...@john-home:~$ cat small.c

extern int printf (__const char *__restrict __format, ...);

static char
foo (char si1, char si2)
{
  return si1* si2;
}

 const  volatile unsigned int g_2[8][3] = {{0L, 0L, 0L}, {0L, 0L, 0L}, {0L,
0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L, 0L}, {0L, 0L,
0L}};
long long g_29 = 1;
int g_40 = 0x105F61CAL;
int *g_39 = &g_40;
 volatile int * volatile g_88[1] = {0};
 volatile int g_429[5] = {1L, 1L, 1L, 1L, 1L};

int  main(void)
{
int * const l_353 = &g_40;
int l_414 = 0xF5B296C2L;
if (!(g_2[5][2]))
{
int l_420 = 0x0332F5C8L;
if (((foo (l_420, (*l_353))) > (!-10L)))
{
for (l_414 = 0; l_414 < 1; l_414 += 1)
{
g_88[l_414] = &g_429[2];
}
(*g_39) = -1;
}
}
printf("checksum g_40 = %d\n", g_40);
return g_29;
}


-- 
   Summary: possible integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/44823] internal compiler error: verify_ssa failed

2010-07-05 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2010-07-05 14:40 ---
Created an attachment (id=21092)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21092&action=view)
failure-inducing C


-- 


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



[Bug c/44823] New: internal compiler error: verify_ssa failed

2010-07-05 Thread regehr at cs dot utah dot edu
Testcase is reduced from ssa-ccp.c from gcc from specCPU2006.

reg...@john-home:~/volatile/bugs/tmp323$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161813-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161813-install
--program-prefix=r161813- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100704 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp323$ current-gcc -O3 small.c

small.c: In function ‘defs_to_undefined.isra.0’:
small.c:83:1: error: definition in block 7 follows the use
for SSA_NAME: pretmp.26_24 in statement:
pretmp.28_4 = (struct rtx_def *) pretmp.26_24;
small.c:83:1: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
   Summary: internal compiler error: verify_ssa failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/44816] New: ice in subst_reloads, at reload.c:6328

2010-07-04 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp418]$ current-gcc -v   
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r161681-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161681-install
--program-prefix=r161681- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100701 (experimental) (GCC) 

[reg...@gamow tmp418]$ current-gcc -Os small.c -c -w

small.c: In function 'int329':
small.c:34:1: internal compiler error: in subst_reloads, at reload.c:6328
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp418]$ cat small.c

static int
foo (int si1, int si2)
{
  return si1 ^ si2 & si1 ^ si1 ^ si2 & ~1 - si2 ^ si2 ? : si1 - si2;
}

static unsigned
bar (unsigned ui1, unsigned ui2)
{
  return ui1 + ui2;
}

int g_29;
int g_75;
int g_83;
int func_53 (unsigned char p_54, long p_55, unsigned char p_56);

int safe (int);

void int325 (long p_6, int p_7)
{
  int *l_28 = &g_29;
  *l_28 |= safe (0) <= foo;
}

void int329 (unsigned long p_50)
{
  int *l_74 = &g_75;
  int *l_82 = &g_83;
  *l_74 ^= foo (func_53 (6L, 1L, 1), 0);
  *l_82 |=
func_53 (0L, 0, 0) <= bar (func_53 (0, 1, 0),
  p_50);
}

int
func_53 (unsigned char p_54, long p_55, unsigned char p_56)
{
  return g_29;
}


-- 
   Summary: ice in subst_reloads, at reload.c:6328
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44695] New: ice in simplify_subreg, at simplify-rtx.c:5117

2010-06-27 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp319$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161425-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161425-install
--program-prefix=r161425- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100626 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp319$ current-gcc -O2 small.c -c 

small.c: In function ‘int81’:
small.c:20:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5117
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp319$ cat small.c

typedef int int32_t;
typedef unsigned char uint8_t;

static uint8_t
safe_div_func_uint8_t_u_u (uint8_t ui1, uint8_t ui2)
{
  return ui2 ? : (ui1 / ui2);
}

int safe (int);
int func_51 (int);

void
int81 (void)
{
  int32_t l_219 = 8L;
  if (safe (safe_div_func_uint8_t_u_u (1 || 0, l_219 & func_51 (0
{
}
}


-- 
   Summary: ice in simplify_subreg, at simplify-rtx.c:5117
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug tree-optimization/44687] [4.6 Regression] ICE: in tree_nrv, at tree-nrv.c:155 with -fprofile-generate

2010-06-27 Thread regehr at cs dot utah dot edu


--- Comment #4 from regehr at cs dot utah dot edu  2010-06-28 05:55 ---
This same ICE also happens w/o -fprofile-generate:

reg...@john-home:~/volatile/bugs/tmp318$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161425-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r161425-install
--program-prefix=r161425- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100626 (experimental) (GCC) 
reg...@john-home:~/volatile/bugs/tmp318$ current-gcc -O2 small.c
small.c: In function ‘func_72’:
small.c:24:1: internal compiler error: in tree_nrv, at tree-nrv.c:155
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
reg...@john-home:~/volatile/bugs/tmp318$ cat small.c
typedef int int32_t;
typedef unsigned char uint8_t;
struct S0
{
  uint8_t f0;
};
struct S0 *g_18[7][5][1][1] = {
};

struct S0 **g_17 = &g_18[0][3][0][0];
int32_t g_86;
struct S0 func_72 (uint8_t p_73, struct S0 p_74);

void int326 (struct S0 **p_67, int32_t p_68, int32_t * *const p_69,
struct S0 *p_70)
{
  struct S0 l_95 = {
-1L
  };
  func_72 (1L, func_72 (0, l_95));
}

struct S0
func_72 (uint8_t p_73, struct S0 p_74)
{
  int32_t *l_85 = &g_86;
  if (*l_85)
  lbl_94:*l_85 ^= 0;
  if (g_86)
goto lbl_94;
  return **g_17;
}


-- 


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



[Bug c/44485] New: ICE in get_expr_operands, at tree-ssa-operands.c:1020

2010-06-09 Thread regehr at cs dot utah dot edu
reg...@gamow tmp414]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r160490-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r160490-install
--program-prefix=r160490- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100609 (experimental) (GCC) 

[reg...@gamow tmp414]$ current-gcc -c -O small.c

small.c: In function 'func_21':
small.c:42:22: warning: assignment makes integer from pointer without a cast
[enabled by default]
unhandled expression in get_expr_operands():
 

small.c: In function 'int324':
small.c:21:6: internal compiler error: in get_expr_operands, at
tree-ssa-operands.c:1020
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp414]$ cat small.c

static int
foo (int si1, int si2)
{
  return si1 > 0 && si2 > 0 && si1 > -si2 || si1 < 0 && si2 < 0
&& si1 < -si2 ? : si1 + si2;
}

struct S0
{
  unsigned short f1;
};
int g_4;
struct S0 g_54 = {
  3428
};

int
func_21 (int * p_22, int * const int32p_24, unsigned p_25,
 const int * p_26);

void int324 (unsigned p_15, int * p_16, int * p_17, int * p_18)
{
  if (foo (g_4, func_21 (p_18, &g_4, 0, 0)))
{
  for (g_54.f1; g_54.f1; g_54.f1 += 1)
{
}
}
}

int
func_21 (int * p_22, int * const int32p_24, unsigned p_25,
 const int * p_26)
{
  for (0; 1; p_25 += 1)
  lbl_29:if (p_25)
  goto lbl_28;
lbl_28:for (p_25 = 0; p_25 < 9; p_25 += 1)
if (p_25)
  goto lbl_29;
  unsigned short l_53;
  for (0; l_53; l_53 = foo)
{
}
  return 0;
}


-- 
   Summary: ICE in get_expr_operands, at tree-ssa-operands.c:1020
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44119] New: error: SSA name in freelist but still referenced

2010-05-13 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp413]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r159348-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r159348-install
--program-prefix=r159348- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100513 (experimental) (GCC) 

[reg...@gamow tmp413]$ current-gcc -O2 -c small.c

small.c: In function 'func_96':
small.c:32:7: warning: overflow in implicit constant conversion [-Woverflow]
small.c:22:1: error: SSA name in freelist but still referenced
pretmp.15_47
small.c:38:13: note: in statement
# .MEM_24 = VDEF <.MEM_21(D)>
*pretmp.8_41 = pretmp.15_47;

small.c:22:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp413]$ cat small.c

typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
static int8_t
safe_mul_func_int16_t_s_s (int16_t si1, int8_t si2)
{
  return si1 && si2 && si1 > +si2 || si1 && si2 && si2 < +si1 || si1 && si2
&& si1 < +si2 || si1 && si2 && si1 && si2 < +si1 ? : si1 * si2;
}

struct S0
{
};
int32_t g_72[7][4][1];
int32_t *g_184 = &g_72[1][2][0];
int32_t **g_224 = &g_184;
struct S0 g_244 = {
};

int8_t *
func_96 (int8_t p_97, uint32_t p_98, uint32_t p_99)
{
  struct S0 *l_243 = &g_244;
  int i;
  for (i = 0; i < 1; p_98 = 1)
{
  int32_t *l_202[3];
  int i;
  for (i = 0; i < 1; i++)
l_202[i] = &g_72[2][2][0];
  if (safe_mul_func_int16_t_s_s (0xC4CAF0, **g_224))
{
  if (p_98 && &l_243)
{
}
  else
*g_224 = l_202[0];
  for (0;; 1)
{
}
}
}
  return 0;
}


-- 
   Summary: error: SSA name in freelist but still referenced
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
          Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44031] New: ice in subst_reloads, at reload.c:6327

2010-05-07 Thread regehr at cs dot utah dot edu
[reg...@bethe tmp600]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r159144-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r159144-install
--program-prefix=r159144- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100507 (experimental) (GCC) 

[reg...@bethe tmp600]$ current-gcc -O -c small.c 

small.c: In function 'int321':
small.c:35:1: internal compiler error: in subst_reloads, at reload.c:6327
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@bethe tmp600]$ cat small.c

typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;

static uint32_t
safe_add_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2)
{
  return ui1 + ui2;
}

static uint64_t
safe_div_func_uint64_t_u_u (uint64_t ui1, uint32_t ui2)
{
  return ui2 ? : (ui1 / ui2);
}

uint8_t g_55;
uint8_t *g_73 = &g_55;
uint8_t **g_332 = &g_73;

int func_38(uint8_t *,int);
int func_8(int);

int int321 (void)
{
  uint8_t l_26[4];
  uint8_t *l_238 = &l_26[2];
  uint8_t l_400;
  l_400 &=
func_38 (&l_26[3],
 safe_add_func_uint32_t_u_u (safe_div_func_uint64_t_u_u
 (1, **g_332),
 *l_238) >= *l_238 < func_8 (0)), 1;
  return 0;
}


-- 
   Summary: ice in subst_reloads, at reload.c:6327
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/44030] New: error: SSA name in freelist but still referenced

2010-05-07 Thread regehr at cs dot utah dot edu
[reg...@bethe tmp601]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r159144-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r159144-install
--program-prefix=r159144- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100507 (experimental) (GCC) 

[reg...@bethe tmp601]$ current-gcc -O2 -c small.c

small.c: In function 'func':
small.c:14:1: error: SSA name in freelist but still referenced
pretmp.6_10
small.c:24:7: note: in statement
g_54.1_5 = pretmp.6_10;

small.c:14:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@bethe tmp601]$ cat small.c

typedef int int32_t;
typedef unsigned int uint32_t;
static uint32_t
safe_sub_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2)
{
  return ui1 - ui2;
}

int32_t l_105[7];

int32_t g_4;
int32_t *g_54 = &g_4;
int32_t *
func (int32_t p_73, int32_t * p_74, int32_t p_75, int32_t * *p_76,
  int32_t * *p_77)
{
lbl_110:for (g_4 = 0; g_4; g_4 = 1)
{
}
  for (p_75 = -28; p_75; p_75 = safe_sub_func_uint32_t_u_u (p_75, 1))
{
  if (g_4)
goto lbl_110;
  *g_54 = 0;
}
  return &l_105[5];
}


-- 
   Summary: error: SSA name in freelist but still referenced
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43842] New: ice in vect_create_epilog_for_reduction

2010-04-21 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp407]$ current-gcc -c -O3 small.c
small.c: In function 'int161':
small.c:19:1: internal compiler error: in vect_create_epilog_for_reduction, at
tree-vect-loop.c:3451
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp407]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r158618-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r158618-install
--program-prefix=r158618- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100421 (experimental) (GCC) 

[reg...@gamow tmp407]$ cat small.c

typedef short int int16_t;
typedef int int32_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
static int16_t
safe_rshift_func_int16_t_s_u (int16_t left, unsigned int right)
{
  return left || right >= 1 * 8 ? left : left >> right;
}

static uint32_t
safe_add_func_uint32_t_u_u (uint32_t ui1, uint16_t ui2)
{
  return ui1 + ui2;
}

int16_t g_4;
uint32_t g_9[1];
int161 (void)
{
  int32_t l_2;
  for (l_2 = -25; l_2; l_2 = safe_add_func_uint32_t_u_u (l_2, 1))
g_9[0] ^= safe_rshift_func_int16_t_s_u (g_4, 1);
  return 0;
}


-- 
   Summary: ice in vect_create_epilog_for_reduction
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43781] New: ice: verify_ssa failed

2010-04-17 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp405]$ current-gcc -c -O2 small.c
small.c: In function 'int32func':
small.c:26:1: error: definition in block 8 follows the use
for SSA_NAME: g_313.0_6 in statement:
# VUSE <.MEM_22>
g_313.8_12 = *g_313.0_6;
small.c:26:1: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp405]$ cat small.c

typedef int int32_t;
typedef unsigned char uint8_t;

struct S0
{
  uint8_t f3;
};

struct S2
{
  uint8_t f5;
};

struct S0 g_22 = {
  0
};

int32_t g_91;
const struct S2 *g_314;
const struct S2 **g_313 = &g_314;
struct S2 g_320[2] = {
  0
};

void
int32func (uint64p_34)
{
  for (g_22.f3 = 0; g_22.f3 <= 0; g_22.f3)
{
lbl_491:{
if (1)
  {
int32_t *l_453[2][7][7][1][1];
int i, j, k, l, m;
for (m; m; m++)
  l_453[i][j][k][l][m];
  }
*g_313 = 0;
if (g_91)
  goto lbl_491;
  }
}
}

[reg...@gamow tmp405]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r158448-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r158448-install
--program-prefix=r158448- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100416 (experimental) (GCC)


-- 
   Summary: ice: verify_ssa failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43679] New: ice in gen_lsm_tmp_name, at tree-ssa-loop-im.c:1812

2010-04-07 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp400]$ current-gcc -c -O2 small.c
small.c: In function 'func_37':
small.c:11:6: internal compiler error: in gen_lsm_tmp_name, at
tree-ssa-loop-im.c:1812
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp400]$ cat small.c

unsigned g_5;
int g_7;
int g_23[2];
int *g_29 = &g_23[0];
int **g_59;
unsigned long g_186;

int foo (int, int);
int bar (int);

void func_37 (long p_38)
{
  int *l_39 = &g_7;
  *l_39 = (*l_39
 ||
 (foo
  (((*g_29 != *l_39, ((bar (g_59 != &l_39), 0), 0))),
   0)));
  foo (*l_39, 0);
  int **l_256 = &l_39;
  {
for (0; g_186; 0)
  {
*l_256 = *l_256;
if (g_5)
  goto lbl_270;
*l_39 &= 0;
  }
  }
lbl_270:
  ;
}

[reg...@gamow tmp400]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r158079-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r158079-install
--program-prefix=r158079- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100407 (experimental) (GCC)


-- 
   Summary: ice in gen_lsm_tmp_name, at tree-ssa-loop-im.c:1812
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43661] New: ice in fold_comparison, at fold-const.c:9579

2010-04-05 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp310$ current-gcc -Os small.c -c
small.c: In function ‘func’:
small.c:10:6: internal compiler error: in fold_comparison, at fold-const.c:9579
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp310$ cat small.c

void
func (int *p_51)
{
  int l_174 = 0;
  l_174 |=
0 ? (unsigned short) (0 ? : 1 *
  (signed char) (*p_51
 ^
 *p_51)
  >= 0) : *p_51 < *p_51 > *p_51 < 1;
}

reg...@john-home:~/volatile/bugs/tmp310$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157975-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157975-install
--program-prefix=r157975- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100406 (experimental) (GCC)


-- 
   Summary: ice in fold_comparison, at fold-const.c:9579
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43614] New: ice in gimple_rhs_has_side_effects, at gimple.c:2248

2010-03-31 Thread regehr at cs dot utah dot edu
There was a big like this earlier but it's marked as resolved, so filing a new
one.

reg...@john-home:~/volatile/bugs/tmp296$ current-gcc -O small.c -c
small.c: In function ‘main’:
small.c:5:5: internal compiler error: in gimple_rhs_has_side_effects, at
gimple.c:2248
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp296$ cat small.c

volatile int g_2[7];

void foo (unsigned);

int main (void)
{
  int i_459 = 0;
  int t2818;
  int t2819;
  volatile char *t2820;
  int t2821;
  volatile char *t2822;
  int *t2823;
  unsigned t2824;
LL655:
  t2822 = (volatile char *)g_2;
  t2821 = i_459;
  t2820 = t2822 + t2821;
  t2823 = (int *)t2820;
  t2824 = *t2823;
  foo (t2824);
  t2818 = i_459;
  t2819 = t2818 + 1;
  i_459 = t2819;
  goto LL655;
}

reg...@john-home:~/volatile/bugs/tmp296$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157896-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157896-install
--program-prefix=r157896- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100331 (experimental) (GCC)


-- 
   Summary: ice in gimple_rhs_has_side_effects, at gimple.c:2248
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug middle-end/40003] apparent spurious uninitialized read from r147052 on integer code

2010-03-28 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2010-03-28 19:34 ---
I no longer see this behavior.


-- 

regehr at cs dot utah dot edu changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WORKSFORME


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



[Bug c/43560] New: possible wrong code bug

2010-03-28 Thread regehr at cs dot utah dot edu
I don't believe the program below should crash when run.

Valgrind says the store at line 20 is at fault, which is strange since it looks
like the "if" branch should execute twice and the "else" branch 0 times.

reg...@john-home:~$ current-gcc -O small.c -o small
reg...@john-home:~$ ./small
Segmentation fault
reg...@john-home:~$ cat small.c
#include 

int g_6[1][2] = {{1,1}};
int g_34 = 0;
int *const g_82 = &g_6[0][1];
int *g_85[2][1] = {{&g_34}, {&g_34}};

void func_4 (void)
{
  int i;
  for (i = 0; i <= 1; i++) {
if (g_6[0][1]) {
  *g_82 = 1;
} else {
  int **l_109 = &g_85[1][0];
  if (&g_82 != l_109) {
  } else {
*l_109 = &g_6[0][1];
  }
  *g_82 = 1;
}
  }
}

int main (void)
{
  func_4();
  return 0;
} 

reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157783-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157783-install
--program-prefix=r157783- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100328 (experimental) (GCC)


-- 
   Summary: possible wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43438] New: possible wrong code bug

2010-03-18 Thread regehr at cs dot utah dot edu
The -O0 result looks right.  This behavior observed on x86 using r157445 and
x64 using r157542.

reg...@john-home:~$ current-gcc -O0 small.c -o small -Wall 
reg...@john-home:~$ ./small
1
reg...@john-home:~$ current-gcc -O1 small.c -o small -Wall 
reg...@john-home:~$ ./small
0
reg...@john-home:~$ cat small.c
extern int printf (__const char *__restrict __format, ...);

static unsigned char g_2 = 1;
static int g_9;
static int *l_8 = &g_9;

static void func_12(int p_13)
{
  int * l_17 = &g_9;
  *l_17 &= 0 < p_13;
}

int main(void)
{
  unsigned char l_11 = 254;
  *l_8 |= g_2;
  l_11 |= *l_8;
  func_12(l_11);
  printf("%d\n", g_9);
  return 0;
} 
reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157445-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157445-install
--program-prefix=r157445- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100314 (experimental) (GCC)


-- 
   Summary: possible wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43367] New: ice: in may_propagate_copy, at tree-ssa-copy.c:85

2010-03-14 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp282]$ current-gcc -O2 small.c
small.c: In function 'int327':
small.c:29:1: internal compiler error: in may_propagate_copy, at
tree-ssa-copy.c:85
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp282]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r157419-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157419-install
--program-prefix=r157419- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100313 (experimental) (GCC) 

[reg...@gamow tmp282]$ cat small.c

unsigned char g_17;

const unsigned char func_39 (unsigned char p_40, unsigned char * p_41)
{
  return 0;
}

void int327 (const unsigned char p_48, unsigned char p_49)
{
  unsigned l_52;
  unsigned char l_58[2];
  int i, j;
  if (func_39 (l_52, &p_49), p_48) {
unsigned char *l_60;
unsigned char *l = &l_58[1];
for (j; j; j++) {
lbl_59:
  break;
}
for (l = 0; 1; l += 1) {
  for (p_49 = 1; p_49; p_49 += 0) {
unsigned char **l_61[1][6];
for (j = 0; j < 1; j++)
  l_61[i][j] = &l_60;
goto lbl_59;
  }
}
  }
}


-- 
   Summary: ice: in may_propagate_copy, at tree-ssa-copy.c:85
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43360] New: possible wrong code bug

2010-03-13 Thread regehr at cs dot utah dot edu
I believe the -O1 result is correct.

reg...@john-home:~/volatile/bugs/tmp290/2$ current-gcc -O1 small.c -o small
reg...@john-home:~/volatile/bugs/tmp290/2$ ./small
11
reg...@john-home:~/volatile/bugs/tmp290/2$ current-gcc -O2 small.c -o small
reg...@john-home:~/volatile/bugs/tmp290/2$ ./small
8
reg...@john-home:~/volatile/bugs/tmp290/2$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157445-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157445-install
--program-prefix=r157445- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100314 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp290/2$ cat small.c

extern int printf (__const char *__restrict __format, ...);

int g_3[9][2];
int l_5[7][6];

void func_1 (void);
void func_1 (void)
{
  int i, j;

  for (i = 0; i < 7; i++) {
for (j = 0; j < 6; j++) {
  l_5[i][j] = 4;
}
  }

  for (g_3[8][0] = 1; g_3[8][0] < 8; g_3[8][0] += 7) {
int *l_6 = &g_3[8][0];
*l_6 = l_5[5][2];
  }

}

int main (void)
{
  func_1 ();
  printf ("%d\n", g_3[8][0]);
  return 0;
}


-- 
   Summary: possible wrong code bug
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43269] possible wrong code bug

2010-03-05 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2010-03-05 18:08 ---
Created an attachment (id=20029)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20029&action=view)
failure-inducing input


-- 


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



[Bug c/43269] New: possible wrong code bug

2010-03-05 Thread regehr at cs dot utah dot edu
I believe the result at -O0 is correct.

reg...@john-home:~/volatile/bugs/tmp276$ current-gcc -O0 small.c -o small
reg...@john-home:~/volatile/bugs/tmp276$ ./small
-1
reg...@john-home:~/volatile/bugs/tmp276$ current-gcc -O1 small.c -o small
reg...@john-home:~/volatile/bugs/tmp276$ ./small
0
reg...@john-home:~/volatile/bugs/tmp276$ cat small.c
int g_21;
int g_211;
int g_261;

static int i, j, k, l, m;

static void func_32 (void)
{
  int * l_359[5][7][1][1][2];
  for (i = 0; i < 5; i++) {
for (j = 0; j < 7; j++) {
  for (k = 0; k < 1; k++) {
for (l = 0; l < 1; l++) {
  for (m = 0; m < 2; m++)
l_359[i][j][k][l][m] = &g_211;
}
  }
}
  }

  if (*l_359[0][0][0][0][0]) {
  lbl_370:
g_21 = 1;
  }

  for (g_261 = -1; g_261 > -2; g_261--) {
if (g_211 + 1) {
  return;
} else {
  g_21 = 1;
  goto lbl_370;
}
  }
}

extern int printf (__const char *__restrict __format, ...);

int main(void)
{
  func_32();
  printf("%d\n", g_261);
  return 0;
}
reg...@john-home:~/volatile/bugs/tmp276$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157243-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157243-install
--program-prefix=r157243- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100305 (experimental) (GCC)


-- 
   Summary: possible wrong code bug
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43255] New: ICE in extract_range_from_assert, at tree-vrp.c:1423

2010-03-04 Thread regehr at cs dot utah dot edu
[reg...@gamow tmp276]$ current-gcc -c -O2 small.c

small.c: In function 'int32func':
small.c:15:6: internal compiler error: in extract_range_from_assert, at
tree-vrp.c:1423
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@gamow tmp276]$ cat small.c

int safe (int);

static unsigned foo (unsigned ui1, unsigned ui2)
{
  return ui1 + ui2;
}

int g_22;
int *volatile g_23 = &g_22;
int **g_282[8][10][1];
int *g_330 = &g_22;
volatile unsigned g_348;
int g_397;

void int32func (const unsigned char p_10)
{
  if (foo
  (~
   (p_10 |
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1]) ==
(*g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10][g_348 % 1])),
1))
{
}
  else if (*g_330 >=
   safe (*g_23 ^
 (**g_282[(unsigned long) g_397 % 8][(unsigned) g_22 % 10]
  [g_348 % 1])) & **g_282[8][10][1], 1)
{
}
}

[reg...@gamow tmp276]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/tmp/z/compiler-install/gcc-r157205-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157205-install
--program-prefix=r157205- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100303 (experimental) (GCC)


-- 
   Summary: ICE in extract_range_from_assert, at tree-vrp.c:1423
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c/43191] New: ice in load_assign_lhs_subreplacements, at tree-sra.c:2459

2010-02-26 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp271$ current-gcc -O2 -c small.c

small.c: In function ‘func_70’:
small.c:46:1: internal compiler error: in load_assign_lhs_subreplacements, at
tree-sra.c:2459
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp271$ cat small.c

struct S0
{
};

struct S1
{
  unsigned f0:27;
  const unsigned:0;
};

struct S2
{
  unsigned f2:1;
};

unsigned char g_4[1][8][3][1][1][1];
unsigned char *g_17;
unsigned char **g_16[1][10][7];

struct S2 g_35 = {
  0
};

struct S2 *g_34 = &g_35;

struct S1 func_86 (unsigned char p_87, struct S2 **p_89)
{
  struct S1 l_92[6][8][1][1] = {
16143586
  }
  ;
  return l_92[0][0][0][0];
}

void func_28 (struct S1 p_30, const struct S1 p_32)
{
}

void func_70 (unsigned char p_72)
{
  unsigned char *const *l_93 = &g_17;
  struct S2 **l_94;
  unsigned char *const *l_97 = &g_17;
  func_28 (func_86 (p_72, 0), 
   func_86 (p_72, &g_34));
}

reg...@john-home:~/volatile/bugs/tmp271$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r157079-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r157079-install --program-prefix=r157079-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100226 (experimental) (GCC)


-- 
   Summary: ice in load_assign_lhs_subreplacements, at tree-
sra.c:2459
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43165] New: ice in simplify_subreg, at simplify-rtx.c:5146

2010-02-24 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp270$ current-gcc -O -g small.c -c

small.c: In function ‘func_24’:
small.c:11:6: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5146
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp270$ cat small.c

#pragma pack(1)
struct S1
{
  unsigned char f0;
  unsigned short f1;
  short f2;
  unsigned f3:24;
};
#pragma pack()

void func_24 (struct S1 p_27)
{
  for (; p_27.f2; p_27.f2 = 1)
{
}
}

reg...@john-home:~/volatile/bugs/tmp270$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r157027-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r157027-install --program-prefix=r157027-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100224 (experimental) (GCC)


-- 
   Summary: ice in simplify_subreg, at simplify-rtx.c:5146
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/43164] New: ice in completely_scalarize_record, at tree-sra.c:85

2010-02-24 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp269$ current-gcc -O small.c -c
small.c: In function ‘func_34’:
small.c:16:1: internal compiler error: in completely_scalarize_record, at
tree-sra.c:855
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp269$ cat small.c

struct S0
{
  unsigned char f0;
  int:0;
};

struct S1
{
  struct S0 f0;
};

struct S1 func_34 (void)
{
  struct S1 l_221 = { { 1 } };
  return l_221;
}

reg...@john-home:~/volatile/bugs/tmp269$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r157027-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r157027-install --program-prefix=r157027-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100224 (experimental) (GCC)


-- 
   Summary: ice in completely_scalarize_record, at tree-sra.c:85
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42952] New: possible integer wrong code bug

2010-02-03 Thread regehr at cs dot utah dot edu
The program below looks to me like it should print "0".

reg...@john-home:~$ current-gcc -O small.c -o small
reg...@john-home:~$ ./small
1
reg...@john-home:~$ cat small.c
extern int printf (__const char *__restrict __format, ...);

static int g_16[1];

static int *g_135 = &g_16[0];
static int *l_15 = &g_16[0];

static void foo (void)
{
  g_16[0] = 1;
  *g_135 = 0;
  *g_135 = *l_15;
  printf("%d\n", g_16[0]);
}

int main(void)
{
   foo();
   return 0;
} 
reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r156486-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r156486-install --program-prefix=r156486-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100204 (experimental) (GCC)


-- 
   Summary: possible integer wrong code bug
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42923] New: ice: verify_stmts failed

2010-02-01 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp264$ current-gcc -c -O2 small.c
small.c: In function ‘node_get_length’:
small.c:33:1: error: type mismatch in binary expression
int

int

size_t

add_acc.0_12 = add_acc.0_4 + D.1984_13;

small.c:33:1: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp264$ cat small.c

typedef unsigned size_t;
size_t strlen(const char *s);

typedef struct _Record
{
  char *name;
} Record;

typedef struct _Node
{
  char type;
  union
  {
struct
{
  Record *record;
  struct _Node *child;
}
function;
  }
  data;
} Node;

int node_get_length (Node * node)
{
  switch (node->type)
{
case 'f':
  return strlen (node->data.function.record->name) + 1 +
node_get_length (node->data.function.child) + 1;
}
  return 0;
}

reg...@john-home:~/volatile/bugs/tmp264$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r156428-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r156428-install --program-prefix=r156428-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100201 (experimental) (GCC)


-- 
   Summary: ice: verify_stmts failed
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42891] New: ice in extract_insn, at recog.c:2097

2010-01-27 Thread regehr at cs dot utah dot edu
Seen on Ubuntu 9.10.  The test case is reduced from the output of the Stalin
Scheme to C compiler.

reg...@john-home:~/z/stalin-0.11$ current-gcc -c small.c -O
small.c: In function ‘f1576’:
small.c:86:1: error: unrecognizable insn:
(insn 42 41 43 10 small.c:79 (parallel [
(set (reg:QI 79)
(if_then_else:SI (unlt:SI (reg:CCFPU 17 flags)
(const_int 0 [0x0]))
(const_int -1 [0x])
(const_int 0 [0x0])))
(clobber (reg:CC 17 flags))
]) -1 (nil))
small.c:86:1: internal compiler error: in extract_insn, at recog.c:2097
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/z/stalin-0.11$ cat small.c

void gt_error (void);
struct region19168
{
  union
  {
  }
  value;
};
struct w29434
{
};
struct w16638
{
  union
  {
  }
  value;
};
struct w12218
{
  union
  {
  }
  value;
};
struct w9140
{
  union
  {
  }
  value;
};
struct w6194
{
  union
  {
  }
  value;
};
struct w3457
{
  union
  {
  }
  value;
};
struct w49
{
  unsigned tag;
  union
  {
int fixnum_type;
float flonum_type;
  }
  value;
};

void
f1576 (struct w49 a15167, struct w49 a15168, unsigned a15169, unsigned a15170,
unsigned t84936, struct w49 t84939, struct w49 t84940)
{
  struct w49 a33604;
  struct w49 t84937;
  struct w16638 t84965;
  switch (t84936)
{
case 5960:
  a33604 = t84937;
  switch (t84939.tag)
{
case 1048:
  switch (t84940.tag)
{
}
case 1052:
  switch (t84940.tag)
{
case 1048:
  if (!((t84939.value.flonum_type) > (t84940.value.fixnum_type)))
goto l16231;
}
  gt_error ();
}
}
l16231:t84965 = *((struct w16638 *) (&a15168));
}

reg...@john-home:~/z/stalin-0.11$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r156271-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r156271-install --program-prefix=r156271-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100127 (experimental) (GCC)


-- 
   Summary: ice in extract_insn, at recog.c:2097
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42730] New: ice: verify_stmts failed

2010-01-13 Thread regehr at cs dot utah dot edu
Seen on Ubuntu 9.10.

reg...@john-home:~/volatile/bugs/tmp255$ current-gcc -Os small.c
small.c: In function ‘foo’:
small.c:14:1: error: non-trivial conversion at assignment
unsigned int *
void *
# .MEM_4 = VDEF <.MEM_3(D)>
u.pa = 0B;

small.c:14:1: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
reg...@john-home:~/volatile/bugs/tmp255$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155838-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155838-install --program-prefix=r155838-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100112 (experimental) (GCC) 
reg...@john-home:~/volatile/bugs/tmp255$ cat small.c
union bzz
{
  unsigned *pa;
  void *pv;
};

void foo (void)
{
  union bzz u;
  void **x;
  void *y = 0;
  x = &u.pv;
  *x = y;
}


-- 
   Summary: ice: verify_stmts failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42721] New: possible integer wrong code bug

2010-01-12 Thread regehr at cs dot utah dot edu
Seen on Ubuntu 9.10.  I think "1" is the right answer.

reg...@john-home:~/volatile/bugs/tmp254$ current-gcc -O1 small.c -o small
reg...@john-home:~/volatile/bugs/tmp254$ ./small
checksum = 1
reg...@john-home:~/volatile/bugs/tmp254$ current-gcc -O2 small.c -o small
reg...@john-home:~/volatile/bugs/tmp254$ ./small
checksum = 0
reg...@john-home:~/volatile/bugs/tmp254$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155838-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155838-install --program-prefix=r155838-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100112 (experimental) (GCC) 
reg...@john-home:~/volatile/bugs/tmp254$ cat small.c
#include 
#include 

static uint64_t safe_div_uint64_t (uint64_t ui1, uint64_t ui2)
{
  return (ui2 == 0) ? ui1 : (ui1 / ui2);
}

static int8_t safe_mod_int8_t (int8_t si1, int8_t si2)
{
  return 
((si2 == 0) || ((si1 == INT8_MIN) && (si2 == (-1 ? 
si1 : 
(si1 % si2);
}

static int32_t g_5;
static int32_t g_11;

int main (void)
{
  uint64_t l_7 = 0x509CB0BEFCDF11BBLL;
  g_11 ^= l_7 && ((safe_div_uint64_t ((safe_mod_int8_t (g_5, 0)), -1L)) != 1L);
  printf ("checksum = %d\n", g_11);
  return 0;
}


-- 
   Summary: possible integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42717] New: ice: verify_ssa failed

2010-01-12 Thread regehr at cs dot utah dot edu
Seen on Ubuntu 9.10.

reg...@john-home:~/volatile/bugs/tmp253$ current-gcc -O2 small.c
small.c: In function ‘bar’:
small.c:16:1: error: definition in block 7 does not dominate use in block 2
for SSA_NAME: l_23_17 in statement:
l_23_2 = PHI 
PHI argument
l_23_17
for PHI node
l_23_2 = PHI 
small.c:16:1: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp253$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155838-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155838-install --program-prefix=r155838-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100112 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp253$ cat small.c

static signed char
foo (signed char si1, unsigned char si2)
{
  return (si1 ^ si2) & (-si2 ^ si2) ? : si1 - si2;
}

struct S0
{
};

unsigned char g_21;

struct S0 g_34;

void
bar (unsigned char p_20)
{
  unsigned char *l_22 = &g_21;
  unsigned char l_23 = 0;
  struct S0 *l = &g_34;
  goto lbl_42;
  for (; l_23; l_23 = foo (l_23, 1))
{
  for (p_20 = 0; 0; p_20 = foo (p_20, 1))
  lbl_42:;
  (l == &g_34) ? 0 : "";
lbl_85:*l_22 = p_20;
}
  goto lbl_85;
}


-- 
   Summary: ice: verify_ssa failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/42716] New: ICE in extract_range_from_assert, at tree-vrp.c:1423

2010-01-12 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/bugs/tmp252$ current-gcc -O2 -c small.c
small.c: In function ‘bar’:
small.c:12:6: internal compiler error: in extract_range_from_assert, at
tree-vrp.c:1423
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp252$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155838-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155838-install --program-prefix=r155838-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100112 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp252$ cat small.c

static short foo (long long si1, short si2)
{
  return si1 > 0 && si2 > 0 && si1 > 9223372036854775807LL - si2 || si1 < 0
&& si2 < 0 && si1 < 1 - si2 ? : si1 + si2;
}

int g_13;
unsigned g_17;

int safe (int, int);

void bar (short p_51, short * p_52)
{
  int *const l_55 = &g_13;
  if (safe (*p_52, g_13 != foo (*p_52 & *l_55 == g_13 && g_17 >= 1, 0)))
{
}
}


-- 
   Summary: ICE in extract_range_from_assert, at tree-vrp.c:1423
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
    AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug middle-end/41925] ICE in get_alias_set, at alias.c:710

2009-12-31 Thread regehr at cs dot utah dot edu


--- Comment #3 from regehr at cs dot utah dot edu  2009-12-31 19:48 ---
See below an extremely small testcase triggering this crash in r155538.

reg...@john-home:~/volatile/bugs/tmp250$ current-gcc -Os -c small.c
small.c:2:1: internal compiler error: in get_alias_set, at alias.c:710
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/bugs/tmp250$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155538-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155538-install --program-prefix=r155538-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091231 (experimental) (GCC) 

reg...@john-home:~/volatile/bugs/tmp250$ cat small.c

typedef unsigned char uint8_t;
uint8_t foo[1000][0];


-- 


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



[Bug c/42512] New: possible integer wrong code bug

2009-12-26 Thread regehr at cs dot utah dot edu
reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r155465-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r155465-install --program-prefix=r155465-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091225 (experimental) (GCC) 
reg...@john-home:~$ current-gcc -O2 small.c -o small
reg...@john-home:~$ ./small
g_3 = -1
reg...@john-home:~$ current-gcc -O3 small.c -o small
reg...@john-home:~$ ./small
g_3 = 255
reg...@john-home:~$ cat small.c
#include 

int g_3;

int main (void)
{
long long l_2;
for (l_2 = -1; l_2 != 0; l_2 = (unsigned char)(l_2 - 1))
{
g_3 |= l_2;
}
printf("g_3 = %d\n", g_3);
return 0;
}


-- 
   Summary: possible integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/41917] Strange athrithmetic result with -O3

2009-11-02 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-11-02 21:56 ---
The problem also appears to exist in 4.4.1.


-- 


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



[Bug c/41805] possible LTO termination bug

2009-10-22 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-10-23 02:50 ---
Forgot to add gcc details:

reg...@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153474-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r153474-install --program-prefix=r153474-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091022 (experimental) (GCC) 


-- 


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



[Bug c/41805] New: possible LTO termination bug

2009-10-22 Thread regehr at cs dot utah dot edu
Using r153474 with LTO, the compilation units below appear to be improperly
turned into a terminating executable.

reg...@john-home:~$ current-gcc -g -Wall -O3 -flto -c rnd_output0.c
reg...@john-home:~$ current-gcc -g -Wall -O3 -flto -c rnd_output1.c
reg...@john-home:~$ current-gcc -g -Wall -O3 -flto rnd_output1.o rnd_output0.o
-o rand 
reg...@john-home:~$ ./rand
Done
reg...@john-home:~$ 
reg...@john-home:~$ cat rnd_output0.c
#include 
#include 

int func_5();

int i = 0;

int func_2()
{
func_5();
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
return 0;
}

int func_1(int p)
{
func_2();
return 0;
}

int main(void)
{
func_1(func_2());
printf ("Done\n");
return 0;
}
reg...@john-home:~$ cat rnd_output1.c
int func_5()
{
while(1)
  ;
return 0;
}


-- 
   Summary: possible LTO termination bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c++/41775] ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-20 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-10-21 04:13 ---
Created an attachment (id=18848)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18848&action=view)
failure inducing input


-- 


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



[Bug c++/41775] New: ice in rewrite_stmt, at tree-into-ssa.c:1302

2009-10-20 Thread regehr at cs dot utah dot edu
This ice prevents the gcc svn head from building the LLVM svn head.

reg...@john-home:~/volatile/tmp208$ current-g++ -c -O3 small.cpp
small.cpp: In member function ‘(anonymous
namespace)::StrongPHIElimination::runOnMachineFunction(llvm::MachineFunction&)’:
small.cpp:281:1: internal compiler error: in rewrite_stmt, at
tree-into-ssa.c:1302
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp208$ current-g++ -v

Using built-in specs.
COLLECT_GCC=current-g++
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153044-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r153044-install --program-prefix=r153044-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091020 (experimental) (GCC)


-- 
   Summary: ice in rewrite_stmt, at tree-into-ssa.c:1302
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c++/41774] New: ice: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757

2009-10-20 Thread regehr at cs dot utah dot edu
Obviously the input is malformed, but probably still should not ICE.

reg...@john-home:~/volatile/tmp208$ current-g++ -O small.cpp
small.cpp:2:27: internal compiler error: vector VEC(visibility,base) pop domain
error, in pop_visibility at c-pragma.c:757
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp208$ current-g++ -v

Using built-in specs.
COLLECT_GCC=current-g++
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153044-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r153044-install --program-prefix=r153044-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091020 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp208$ cat small.cpp

namespace std __attribute__ ((__visibility__ ("default"))) {
#pragma GCC visibility pop


-- 
   Summary: ice: vector VEC(visibility,base) pop domain error, in
pop_visibility at c-pragma.c:757
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/41555] possible miscompilation in whole-program mode

2009-10-03 Thread regehr at cs dot utah dot edu


--- Comment #3 from regehr at cs dot utah dot edu  2009-10-03 16:44 ---
Making the variables static in addition to the functions causes the problem to
happen at -O3.  

The bad behavior happens at -O3 only if g_101 is static.


-- 


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



[Bug c/41555] possible miscompilation in whole-program mode

2009-10-03 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-10-03 16:42 ---
Created an attachment (id=18696)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18696&action=view)
failure-inducing input

There is no problem here at -O3.  However if you make g_101 static then the
wrong answer is returned at -O3.


-- 


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



[Bug c/41555] New: possible miscompilation in whole-program mode

2009-10-03 Thread regehr at cs dot utah dot edu
The test input below is really gross but I couldn't easily reduce it more.  

The behavior leading to the apparent bad execution is actually pretty simple:
the "if" test in func_19() is true and so the store to g_133 must execute.

reg...@john-home:~/volatile/tmp201$ current-gcc -O3 small.c -o small
reg...@john-home:~/volatile/tmp201$ ./small
checksum = 1
reg...@john-home:~/volatile/tmp201$ current-gcc -O3 -fwhole-program small.c -o
small
reg...@john-home:~/volatile/tmp201$ ./small
checksum = 0

reg...@john-home:~/volatile/tmp201$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r152425-install
--program-prefix=r152425- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091002 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp201$ cat small.c

#include 
#include 
#include 
#include 

static uint64_t safe_div_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
{
  if (_ui2==0) return _ui1;
  return _ui1 / _ui2;
}

static int64_t safe_div_func_int64_t_s_s (int64_t _si1, int64_t _si2)
{
  if (_si2==0 || (_si1==INT64_MIN && _si2==-1)) return _si1;
  return _si1 / _si2;
}

#define safe_add_macro_int8_t_s_s(si1,si2) \
((int8_t)(si1))>((int8_t)0)) &&
(((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) >
((INT8_MAX)-((int8_t)(si2) \
  || int8_t)(si1))<((int8_t)0)) &&
(((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) <
((INT8_MIN)-((int8_t)(si2)) \
 ? ((int8_t)(si1)) \
 : (((int8_t)(si1)) + ((int8_t)(si2))) \
 ) 

static int8_t
safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
{
  return safe_add_macro_int8_t_s_s(_si1,_si2);
}

#define safe_rshift_macro_uint64_t_u_s(left,right) \
(int)(right)) < ((uint64_t)0)) \
 || (((int)(right)) >= sizeof(uint64_t)*CHAR_BIT)) \
? ((uint64_t)(left)) \
: (((uint64_t)(left)) >> ((int)(right

static uint64_t
safe_rshift_func_uint64_t_u_s(uint64_t _left, int _right)
{
  return safe_rshift_macro_uint64_t_u_s(_left,_right);
}

#define safe_mul_macro_int32_t_s_s(si1,si2) \
  ((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) &&
(((int32_t)(si1)) > ((INT32_MAX) / ((int32_t)(si2) || \
  int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) &&
(((int32_t)(si2)) < ((INT32_MIN) / ((int32_t)(si1) || \
  int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) &&
(((int32_t)(si1)) < ((INT32_MIN) / ((int32_t)(si2) || \
  int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) &&
(((int32_t)(si1)) != ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MAX) /
((int32_t)(si1)) \
  ? ((int32_t)(si1)) \
  : ((int32_t)(si1)) * ((int32_t)(si2)))

static int32_t
safe_mul_func_int32_t_s_s (int32_t _si1, int32_t _si2)
{
  return safe_mul_macro_int32_t_s_s(_si1,_si2);
}

int8_t g_39;
volatile uint8_t g_46;
uint8_t g_47;
uint8_t *g_62;
uint8_t g_79;
int8_t g_101 = -1L;
uint8_t *g_114;
uint8_t *g_126;
uint8_t g_133;

uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38);
uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38)
{
  assert (g_62 == 0);
  for (g_39 = 1; g_39 < 0; g_39 = 1)
{
}
  return 1;
}

int32_t func_19 (int32_t p_20);
int32_t func_19 (int32_t p_20)
{
  if (1 !=
  safe_div_func_uint64_t_u_u ((safe_div_func_int64_t_s_s (p_20, 1)),
  g_101))
{
  func_35 (0, 1 <= (safe_add_func_int8_t_s_s (g_47, g_46)) > p_20 < 1, 1);
  g_133 = 1;
  assert (g_114 == 0);
  assert (g_126 == 0);
}
  return 1;
}

uint8_t func_2 (int32_t p_6);
uint8_t func_2 (int32_t p_6)
{
  for (1; p_6 > 1; 1)
return 0;
  func_19 (g_79);
  if (safe_mul_func_int32_t_s_s
  ((0, 1 < (safe_rshift_func_uint64_t_u_s (1 ^ p_6, 1))),
   (func_35 (&p_6, 1, 1) < 1)))
{
}
  return 1;
}

int main (void)
{
  func_2 (1);
  printf ("checksum = %d\n", g_133);
  return 0;
}


-- 
   Summary: possible miscompilation in whole-program mode
       Product: gcc
       Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/41497] New: apparent integer wrong code bug

2009-09-28 Thread regehr at cs dot utah dot edu
It looks wrong at -Os.  The compiler is valgrind-clean at that level.

reg...@john-home:~/volatile/tmp200$ current-gcc -O small.c -o small
reg...@john-home:~/volatile/tmp200$ ./small
checksum = -13

reg...@john-home:~/volatile/tmp200$ current-gcc -Os small.c -o small
reg...@john-home:~/volatile/tmp200$ ./small
checksum = 65523

reg...@john-home:~/volatile/tmp200$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r152261-install
--program-prefix=r152261- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090929 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp200$ cat small.c

#include 
#include 

static uint16_t add (uint16_t ui1, uint16_t ui2)
{
  return ui1 + ui2;
}

uint32_t g_108;
uint8_t f3;
uint8_t f0;

void func_1 (void);
void func_1 (void)
{
  for (f3 = 0; f3 <= 0; f3 = 1) {
for (g_108 = -13; g_108 == 0; g_108 = add (g_108, 0)) {
  f0 = 1;
}
  }
}

int
main (void)
{
  func_1 ();
  printf ("checksum = %d\n", g_108);
  return 0;
}


-- 
   Summary: apparent integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/41441] New: failure to warn about uninitialized induction var

2009-09-22 Thread regehr at cs dot utah dot edu
In foo() below, I'd expect gcc to emit a warning about use of i without
initialization, but this does not happen.

reg...@john-home:~$ current-gcc -O -Wall uninit.c -o uninit
reg...@john-home:~$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r151949-install
--program-prefix=r151949- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090921 (experimental) (GCC) 
reg...@john-home:~$ cat uninit.c

#include 

void foo (void) {
  int i;
  for (; i<10; i=11) {
  }
}

int main (void)
{
  foo();
  return 0;
}


-- 
   Summary: failure to warn about uninitialized induction var
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40862] ICE in simplify_subreg, at simplify-rtx.c:4981

2009-07-26 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-07-26 20:30 ---
Argh sorry... a search on "simplify_subreg" appeared to return no matches but
perhaps I had a typo.


-- 


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



[Bug c/40862] New: ICE in simplify_subreg, at simplify-rtx.c:4981

2009-07-26 Thread regehr at cs dot utah dot edu
Seen on Ubuntu Hardy.

reg...@john-home:~/volatile/tmp179$ current-gcc -O3 -c small.c
small.c: In function ‘box’:
small.c:29:3: warning: overflow in implicit constant conversion
small.c:31:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:4981
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp179$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r150096-install
--program-prefix=r150096- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090726 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp179$ cat small.c

int foo (int _left, int _right)
{
  return 1 >= 1 * 8 || 9223372036854775807LL >> _right ? : 0;
}

signed char bar (signed char _ui1, signed char _ui2)
{
  return _ui1;
}

signed char baz (int _ui1, signed char _ui2)
{
  return _ui1 * _ui2;
}

volatile signed char g_35;

int func_16 (int p_17, signed char p_19)
{
  if (foo (1, bar (p_17, 1)))
if (g_35)
  {
  }
  return 0;
}

void box (signed char p_13, signed char p_14)
{
  signed char l_133 = 0xF5C80580;
  func_16 (baz (l_133, g_35), 1);
}


-- 
   Summary: ICE in simplify_subreg, at simplify-rtx.c:4981
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40861] New: ICE in simplify_subreg, at simplify-rtx.c:4981

2009-07-26 Thread regehr at cs dot utah dot edu
Seen on Ubuntu Hardy.

reg...@john-home:~/volatile/tmp179$ current-gcc -O3 -c small.c
small.c: In function ‘box’:
small.c:29:3: warning: overflow in implicit constant conversion
small.c:31:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:4981
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp179$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r150096-install
--program-prefix=r150096- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090726 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp179$ cat small.c

int foo (int _left, int _right)
{
  return 1 >= 1 * 8 || 9223372036854775807LL >> _right ? : 0;
}

signed char bar (signed char _ui1, signed char _ui2)
{
  return _ui1;
}

signed char baz (int _ui1, signed char _ui2)
{
  return _ui1 * _ui2;
}

volatile signed char g_35;

int func_16 (int p_17, signed char p_19)
{
  if (foo (1, bar (p_17, 1)))
if (g_35)
  {
  }
  return 0;
}

void box (signed char p_13, signed char p_14)
{
  signed char l_133 = 0xF5C80580;
  func_16 (baz (l_133, g_35), 1);
}


-- 
   Summary: ICE in simplify_subreg, at simplify-rtx.c:4981
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40762] New: possible integer miscompilation

2009-07-14 Thread regehr at cs dot utah dot edu
Seen on Ubuntu Hardy.  The -O2 result seems to be wrong.  Also valgrind says
this about the -O2 compilation:

==6729== Conditional jump or move depends on uninitialised value(s)
==6729==at 0x84F22CB: solve_graph (tree-ssa-structalias.c:1570)



reg...@john-home:~/volatile/tmp174$ current-gcc -O1 small.c -o small
reg...@john-home:~/volatile/tmp174$ ./small
checksum = 0
reg...@john-home:~/volatile/tmp174$ current-gcc -O2 small.c -o small
reg...@john-home:~/volatile/tmp174$ ./small
checksum = 1
reg...@john-home:~/volatile/tmp174$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r149650-install
--program-prefix=r149650- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090714 (experimental) (GCC) 
reg...@john-home:~/volatile/tmp174$ cat small.c
#include 
#include 
#include 

uint8_t g_4;
int64_t g_10;
uint8_t g_56;
uint8_t g_64;

static uint8_t safe_rshift_func_uint8_t_u_u(uint8_t left, unsigned int right)
{
  return unsigned int)(right)) >= sizeof(uint8_t)*CHAR_BIT)
  ? ((uint8_t)(left))
  : (((uint8_t)(left)) >> ((unsigned int)(right;
}

int32_t func_53 (void);
int32_t func_53 (void)
{
  if (safe_rshift_func_uint8_t_u_u (g_56, g_10))
{
}
  else
for (g_10 = 0; g_10; g_10 = 1)
  {
  }
  return 1;
}

int32_t func_36 (void);
int32_t func_36 (void)
{
  uint8_t p_40;
  g_10 = 1;
  g_10 && func_53 ();
  p_40 = g_10 || g_4;
  g_64 = g_10;
  return 1;
}

int
main (void)
{
  func_36 ();
  printf ("checksum = %d\n", g_64);
  return 0;
}


-- 
   Summary: possible integer miscompilation
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40759] New: segfault

2009-07-14 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/tmp173$ current-gcc -c -Wall -O2 small.c
small.c: In function ‘func_150’:
small.c:65:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp173$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r149650-install
--program-prefix=r149650- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090714 (experimental) (GCC) 

reg...@john-home:~/volatile/tmp173$ cat small.c

struct S0 {
  signed char f0;
  signed char f4;
};

struct S0 g_19 = {
  7L, 0L
};

struct S0 g_39 = {
  0L, 0x49L
};

struct S0 g_90 = {
  1L, 0
};

signed char g_125;
signed char g_198;
signed char g_218;

signed char func_17 (int p_18, struct S0 p_20, signed char p_22, signed char
p_24)
{
  return p_20.f0;
}

signed char func_61 (int p_63, signed char p_64, signed char p_65)
{
  return 0;
}

struct S0 func_176 (int p_178, int p_179)
{
  return g_90;
}

struct S0 func_160 (int p_161, int p_163)
{
  struct S0 l_240 = {
9L, 0L
  };
  if (func_17 (1, func_176 (g_218, 1), 1, 1))
{
  struct S0 l_253 = {
0xE0, 0xB4L
  };
  return l_253;
}
  return l_240;
}

struct S0 func_150 (int p_151, signed char p_153, signed char p_154, signed
char p_155)
{
  signed char l_156 = 0;
  signed char l_266 = 0;
  if (func_17
  (func_61
   (g_125, l_156,
func_61 (1, func_17 (1, func_160 (l_266, g_90.f4), p_153, 1), 1)),
   func_176 (g_39.f0, 1), 1, 1))
{
  g_198 = 1;
}
  return g_19;
}


-- 
   Summary: segfault
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40390] possible integer wrong code bug

2009-06-09 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-06-09 19:10 ---
Ah.. promotion to int trumps the casts to unsigned.  Thanks and sorry for the
spurious report.

(In reply to comment #1)
> Subject: Re:   New: possible integer wrong code bug
> 
> On Tue, 9 Jun 2009, regehr at cs dot utah dot edu wrote:
> 
> > reg...@john-home:~$ cat foo.c
> > #include 
> > 
> > int foo(int y)
> > {
> >   return (((unsigned short)y*(unsigned short)-2)>=(y?0:y));
> 
> This involves a signed integer overflow, 65534*65534.  -Wstrict-overflow=3 
> warns you about this.
> 


-- 

regehr at cs dot utah dot edu changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug c/40390] New: possible integer wrong code bug

2009-06-09 Thread regehr at cs dot utah dot edu
I believe that the program below is well-formed and that it is miscompiled by
r148318 at -Os.

reg...@john-home:~$ cat foo.c
#include 

int foo(int y)
{
  return (((unsigned short)y*(unsigned short)-2)>=(y?0:y));
}

int main (void)
{
  printf ("%d\n", foo(-2));
  return 0;
}
reg...@john-home:~$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r148318-install
--program-prefix=r148318- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090609 (experimental) (GCC) 
reg...@john-home:~$ current-gcc -Os foo.c -o foo
reg...@john-home:~$ ./foo
1
reg...@john-home:~$ current-gcc -O0 foo.c -o foo
reg...@john-home:~$ ./foo
0
reg...@john-home:~$ gcc-4.1 -Os foo.c -o foo
reg...@john-home:~$ ./foo
0
reg...@john-home:~$ gcc-4.2 -Os foo.c -o foo
reg...@john-home:~$ ./foo
0
reg...@john-home:~$ icc -Os foo.c -o foo
reg...@john-home:~$ ./foo
0


-- 
   Summary: possible integer wrong code bug
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/40003] apparent spurious uninitialized read from r147052 on integer code

2009-05-01 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-05-02 05:47 ---
Created an attachment (id=17790)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17790&action=view)
preprocessed failure-inducing input


-- 


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



[Bug c/40003] New: apparent spurious uninitialized read from r147052 on integer code

2009-05-01 Thread regehr at cs dot utah dot edu
urn 0;
}


-- 
   Summary: apparent spurious uninitialized read from r147052 on
integer code
   Product: gcc
   Version: unknown
    Status: UNCONFIRMED
      Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/39886] New: ICE in purge_dead_edges, at cfgrtl.c:2274

2009-04-24 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/tmp147$ current-gcc -O2 small.c -Wall -c
small.c: In function ‘uint8func’:
small.c:9: internal compiler error: in purge_dead_edges, at cfgrtl.c:2274
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp147$ cat small.c

int func(int);

volatile unsigned char g_100;

void uint8func (int p_34)
{
  char l_125 = 0xE1;
  func ((func ((p_34 & g_100) <= l_125), 1));
}

reg...@john-home:~/volatile/tmp147$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r146634-install
--program-prefix=r146634- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090423 (experimental) (GCC)


-- 
   Summary: ICE in purge_dead_edges, at cfgrtl.c:2274
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/39635] integer wrong code bug on AVR

2009-04-03 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-04-04 05:44 ---
To be clear: func_7() should return 1, but does not at -O2 and -Os.

In the Avrora output the result of the function looks like this: 

  r30:r31 = 0x0001

or 

  r30:r31 = 0x0C00


-- 

regehr at cs dot utah dot edu changed:

   What|Removed |Added

Summary|integer wrong code bug on   |integer wrong code bug on
   |AVR |AVR


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



[Bug c/39635] New: integer wrong code bug on AVR

2009-04-03 Thread regehr at cs dot utah dot edu
See below.  This bug was found using Avrora bug is reproducible in AVR studio. 

The problem exists in HEAD but not apparently in the 4.3 series.

The generated code looks to be wrong at -O2 and -Os.

reg...@john-home:~$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp :
(reconfigured) ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp :
(reconfigured) ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp
Thread model: single
gcc version 4.5.0 20090403 (experimental) (GCC) 
reg...@john-home:~$ avr-gcc -O1 -mmcu=atmega128 small.c -o small.elf 
reg...@john-home:~$ java avrora.Main -colors=false -monitors=break small.elf
Avrora [Beta 1.7.107] - (c) 2003-2007 UCLA Compilers Group

Loading small.elf...[OK: 0.060 seconds]
=={ Simulation events }===
Node  Time   Event
--
   0   178  break instruction @ 0x0130, r30:r31 = 0x0001
==
Simulated time: 179 cycles
Time for simulation: 0.061 seconds
Total throughput: 0.0029344263 mhz
reg...@john-home:~$ avr-gcc -O2 -mmcu=atmega128 small.c -o small.elf 
reg...@john-home:~$ java avrora.Main -colors=false -monitors=break small.elf
Avrora [Beta 1.7.107] - (c) 2003-2007 UCLA Compilers Group

Loading small.elf...[OK: 0.057 seconds]
=={ Simulation events }===
Node  Time   Event
--
   0   166  break instruction @ 0x0122, r30:r31 = 0x0C00
==
Simulated time: 167 cycles
Time for simulation: 0.061 seconds
Total throughput: 0.002737705 mhz
reg...@john-home:~$ cat small.c
#include 
#include 

#define safe_mod_macro_uint8_t_u_u(ui1,ui2) \
uint8_t)(ui2)) == ((uint8_t)0)) \
? ((uint8_t)(ui1)) \
: (((uint8_t)(ui1)) % ((uint8_t)(ui2

static uint8_t
safe_mod_func_uint8_t_u_u (uint8_t _ui1, uint8_t _ui2)
{
  return safe_mod_macro_uint8_t_u_u(_ui1,_ui2);
}

#define safe_lshift_macro_uint16_t_u_u(left,right) \
 (unsigned int)(right)) >= sizeof(uint16_t)*CHAR_BIT) \
 || (((uint16_t)(left)) > ((UINT16_MAX) >> ((unsigned
int)(right) \
? ((uint16_t)(left)) \
: (((uint16_t)(left)) << ((unsigned int)(right

static uint16_t
safe_lshift_func_uint16_t_u_u(uint16_t _left, unsigned int _right)
{
  return safe_lshift_macro_uint16_t_u_u(_left,_right);
}

int8_t func_7 (uint8_t p_8);
int8_t func_7 (uint8_t p_8)
{
  if (safe_mod_func_uint8_t_u_u (0xC, safe_lshift_func_uint16_t_u_u (p_8,
p_8)))
{
  return 0;
}
  return 1;
}

static inline void platform_main_end(int8_t crc);
static inline void platform_main_end(int8_t crc)
{
  asm volatile("cli" "\n\t"
   "mov r30, %A0" "\n\t"
   "mov r31, %B0" "\n\t"
   "break"
   :
   : "r" (crc)
   : "memory"
   );
}

int main (void)
{
  platform_main_end (func_7(1));
  return 0;
}


-- 
   Summary: integer wrong code bug on AVR
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
     Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: avr


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



[Bug c/39633] New: loop bug on AVR

2009-04-03 Thread regehr at cs dot utah dot edu
In the code below, g_52 should end up being 5.  At -O1, avr-gcc-4.5.0 puts 1
into this variable.  Verified using AVR Studio.  4.3.3 also seems to have this
bug.

reg...@john-home:~/volatile/work0/014255$ avr-gcc -O1 small.c -mmcu=atmega128
-o small.elf
reg...@john-home:~/volatile/work0/014255$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp :
(reconfigured) ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp :
(reconfigured) ../configure --prefix=/home/regehr/avrgcc440/install
--target=avr --enable-languages=c,c++ --disable-nls --disable-libssp
Thread model: single
gcc version 4.5.0 20090403 (experimental) (GCC) 
reg...@john-home:~/volatile/work0/014255$ cat small.c
#include 
#include 

#define safe_add_macro_int8_t_s_s(si1,si2) \
((int8_t)(si1))>((int8_t)0)) &&
(((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) >
((INT8_MAX)-((int8_t)(si2) \
  || int8_t)(si1))<((int8_t)0)) &&
(((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) <
((INT8_MIN)-((int8_t)(si2)) \
 ? ((int8_t)(si1)) \
 : (((int8_t)(si1)) + ((int8_t)(si2))) \
 ) 

static int8_t
safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
{
  return safe_add_macro_int8_t_s_s(_si1,_si2);
}

uint8_t g_52;

void func_1 (void);
void func_1 (void)
{
  uint64_t l_116;
  for (l_116 = 0; l_116 < 13; l_116 = safe_add_func_int8_t_s_s (l_116, 3))
{
  g_52++;
}
}

static inline void platform_main_end(uint32_t crc);
static inline void platform_main_end(uint32_t crc)
{
uint16_t crc16 = crc ^ (crc >> 16);

asm volatile("cli" "\n\t"
 "mov r30, %A0" "\n\t"
 "mov r31, %B0" "\n\t"
 "break"
 :
 : "r" (crc16)
 : "memory"
 );
}

int main (void)
{
  func_1 ();
  platform_main_end (g_52);
  return 0;
}


-- 
   Summary: loop bug on AVR
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
          Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: avr


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



[Bug target/39232] apparent bizarre miscompilation on AVR

2009-03-04 Thread regehr at cs dot utah dot edu


--- Comment #4 from regehr at cs dot utah dot edu  2009-03-04 22:22 ---
We narrowed this down to a nasty Avrora bug.

In the future we'll try to reproduce in AVR Studio before reporting.


-- 

regehr at cs dot utah dot edu changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WORKSFORME


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



[Bug target/34299] [avr] ICE on function attribute syntax for main()

2009-02-26 Thread regehr at cs dot utah dot edu


--- Comment #11 from regehr at cs dot utah dot edu  2009-02-26 23:29 ---
Subject: Re:  [avr] ICE on function attribute syntax for
 main()

Great!

John


jxyang at cs dot utah dot edu wrote:
> --- Comment #10 from jxyang at cs dot utah dot edu  2009-02-26 23:24 
> ---
> Created an attachment (id=17370)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17370&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17370&action=view)
> patch for bug 34299
> 
> DECL_ASSEMBLER_NAME has a side effect of setting assembler_name for functions
> if that attribute is missing, which causes the assertion failure in c-decl.c.
> 
> Change it to less harmful DECL_NAME.
> 
> 


-- 


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



[Bug target/34299] [avr] ICE on function attribute syntax for main()

2009-02-25 Thread regehr at cs dot utah dot edu


--- Comment #8 from regehr at cs dot utah dot edu  2009-02-25 20:01 ---
Sorry for the dup.

This bug prevents compilation of almost all TinyOS apps using 4.3.3!  Is there
a workaround?


-- 


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



[Bug c/39307] New: avr-gcc ICE in start_function, at c-decl.c:6248

2009-02-25 Thread regehr at cs dot utah dot edu
Seen in avr-gcc 4.3.3 built using the script that comes with FemtoOS 0.88.

[reg...@babel tmp40]$ avr-gcc -mmcu=atmega128 small.c
small.c:3: internal compiler error: in start_function, at c-decl.c:6248
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[reg...@babel tmp40]$ cat small.c

__attribute ((signal))
void __vector_15 (void)
{
}

[reg...@babel tmp40]$ avr-gcc -v

Using built-in specs.
Target: avr
Configured with: ../gcc-4.3.3/configure --prefix=/home/regehr/z/avr-gcc-test
--target=avr --with-gnu-ld --with-gnu-as --enable-languages=c,c++ --disable-nls
--disable-libssp --with-dwarf2
Thread model: single
gcc version 4.3.3 (GCC)


-- 
   Summary: avr-gcc ICE in start_function, at c-decl.c:6248
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr


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



[Bug target/39232] apparent bizarre miscompilation on AVR

2009-02-19 Thread regehr at cs dot utah dot edu


--- Comment #3 from regehr at cs dot utah dot edu  2009-02-20 03:44 ---
Created an attachment (id=17335)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17335&action=view)
diff between broken and working assembly

This is a diff between the attachment compiled at -O0 and the same program but
with the declaration and initialization of l_46 commented out.  The first
problem (I claim) produces incorrect output, the second correct.  So this diff
has to show the problem.  

The change is to turn func_43() to this:

int32_t func_43 (int64_t p_44)
{
  int16_t l_45 = 1;
  //int16_t l_46 = 1;
  return l_45;
}


-- 


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



[Bug target/39232] apparent bizarre miscompilation on AVR

2009-02-19 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-02-20 03:32 ---
Created an attachment (id=17334)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17334&action=view)
failure-inducing C program


-- 


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



[Bug c/39232] apparent bizarre miscompilation on AVR

2009-02-18 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-02-18 16:41 ---
Created an attachment (id=17326)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17326&action=view)
failure-inducing C program


-- 


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



[Bug c/39232] New: apparent bizarre miscompilation on AVR

2009-02-18 Thread regehr at cs dot utah dot edu
This is seen on the version of avr-gcc 4.3.3 that gets built by the script that
comes with FemtoOS 0.88.

I'm compiling like this:

  avr-gcc -mmcu=atmega128 -O0 small_preprocessed.c -o small.elf

And observing the result of a run like this:

  java -server avrora.Main -platform=mica2 -simulation=sensor-network
-monitors=break -colors=false -seconds=15 small.elf

Of course you need Avrora installed to do this.

The program computes a checksum over its globals before terminating, this is
found in the Avrora output as: 

  r30:r31 = 0x5DAD

It can be seen that the checksum computed at -O0 is different from higher
optimization levels, which give 0xDBFA.  My belief is that the -O0 result is
wrong, and here's why: deleting almost any line of code from the program causes
it to have the same checksum at all optimization levels.  To see this, delete
for example the line "int16_t l_46 = 1;" in func_43().  This line obviously has
no effect on the computation.  This changes the checksum to 0xDBFA, which is in
agreement with higher optimization levels.

The test code is obviously nonsense.  However, I cannot give a smaller testcase
since deleting code makes the problem go away.

My belief is that this problem in not the result of a stack overflow: my stack
analysis tool estimates that maximum RAM usage (including stack) is 2496 bytes,
leaving plenty of free space on the mega128.

My believe is that this problem is no due to undefined behavior in the C code.


-- 
   Summary: apparent bizarre miscompilation on AVR
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr


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



[Bug c/39223] volatile bug on AVR

2009-02-17 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-02-18 04:59 ---
Created an attachment (id=17318)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17318&action=view)
asm displaying volatile bug


-- 


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



[Bug c/39223] volatile bug on AVR

2009-02-17 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2009-02-18 04:58 ---
Created an attachment (id=17317)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17317&action=view)
failure-inducing C program


-- 


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



[Bug c/39223] New: volatile bug on AVR

2009-02-17 Thread regehr at cs dot utah dot edu
This bug is seen using the avr-gcc that is built using the script that comes
with FemtoOS 0.88.

Compile the attached program like this:

  avr-gcc -O -mmcu=atmega128 small.c -S

It can be seen that func_45() unconditionally loads from volatile g_54.  That
is wrong, since in the C code the load is protected by a test.


-- 
   Summary: volatile bug on AVR
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr


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



[Bug c/39212] New: ice for AVR target: unable to find a register to spill in class 'POINTER_REGS'

2009-02-16 Thread regehr at cs dot utah dot edu
This bug is seen using the avr-gcc that gets built by the script that comes
with FemtoOS 0.88.

reg...@john-home:~/volatile/tmp140$ avr-gcc -O1 small.c
small.c: In function 'uint32func':
small.c:22: error: unable to find a register to spill in class 'POINTER_REGS'
small.c:22: error: this is the insn:
(insn 61 59 141 4 small.c:20 (set (reg:SI 24 r24 [55])
(ashiftrt:SI (subreg:SI (reg/v:DI 46 [ p_48 ]) 0)
(const_int 31 [0x1f]))) 60 {ashrsi3} (nil))
small.c:22: confused by earlier errors, bailing out

reg...@john-home:~/volatile/tmp140$ avr-gcc -v 

Using built-in specs.
Target: avr
Configured with: ../gcc-4.3.3/configure --prefix=/home/regehr/avr-gcc-test
--target=avr --with-gnu-ld --with-gnu-as --enable-languages=c,c++ --disable-nls
--disable-libssp --with-dwarf2
Thread model: single
gcc version 4.3.3 (GCC) 

reg...@john-home:~/volatile/tmp140$ cat small.c

typedef int uint64_t __attribute__ ((__mode__ (__DI__)));

static long int safe_mod_func_int32_t_s_s (long int _si1, long int _si2)
{
  return -1 ? _si1 : 1;
}

uint64_t safe_sub_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
{
  return 0;
}

int foo (int,int,int);
int bar (int);

long int g_14; 

int uint32func (uint64_t p_48)
{
  return foo (safe_mod_func_int32_t_s_s (p_48, 0) ==
   safe_sub_func_uint64_t_u_u (g_14, 1), bar (g_14 == 1), 1);
}


-- 
   Summary: ice for AVR target: unable to find a register to spill
in class 'POINTER_REGS'
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr


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



[Bug c/38942] possible integer codegen error

2009-01-24 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2009-01-24 20:10 ---
Reconfirmed using r143648.


-- 


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



[Bug c/38942] New: possible integer codegen error

2009-01-22 Thread regehr at cs dot utah dot edu
Seen using r143582 on Ubuntu Hardy.  I'm pretty sure this is a miscompilation
at -O2.

The safe_* macros are basically just macroizations of safe math functions from
here:

https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow

reg...@john-home:~/volatile/tmp127$ current-gcc -O1 small.c -o small
reg...@john-home:~/volatile/tmp127$ ./small
reg...@john-home:~/volatile/tmp127$ current-gcc -O2 small.c -o small
reg...@john-home:~/volatile/tmp127$ ./small
small: small.c:29: func_31: Assertion `0' failed.
Aborted
reg...@john-home:~/volatile/tmp127$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r143582-install
--program-prefix=r143582- --enable-languages=c,c++
Thread model: posix
gcc version 4.4.0 20090123 (experimental) (GCC) 
reg...@john-home:~/volatile/tmp127$ cat small.c
#include 
#include 
#include 
#include 
#include 

#define safe_sub_macro_int8_t_s_s(si1,si2) \
((int8_t)(si1))^((int8_t)(si2))) \
& (int8_t)(si1)) ^ int8_t)(si1))^((int8_t)(si2))) \
& (((int8_t)1) <<
(sizeof(int8_t)*CHAR_BIT-1-((int8_t)(si2)))^((int8_t)(si2 <
((int8_t)0)) \
? ((int8_t)(si1)) \
: (((int8_t)(si1)) - ((int8_t)(si2))) \
)

#define safe_add_macro_int16_t_s_s(si1,si2) \
((int16_t)(si1))>((int16_t)0)) &&
(((int16_t)(si2))>((int16_t)0)) && (((int16_t)(si1)) >
((INT16_MAX)-((int16_t)(si2) \
  || int16_t)(si1))<((int16_t)0)) &&
(((int16_t)(si2))<((int16_t)0)) && (((int16_t)(si1)) <
((INT16_MIN)-((int16_t)(si2)) \
 ? ((int16_t)(si1)) \
 : (((int16_t)(si1)) + ((int16_t)(si2))) \
 ) 

uint32_t g_113;

void func_31 (uint8_t p_33)
{
  uint32_t l_40 = 0x0A6F85D5L;
  if (0 >= safe_sub_macro_int8_t_s_s (1 < p_33, safe_add_macro_int16_t_s_s
(l_40, 1))) {
  } else {
assert (0);
  }
}

int main (void)
{
  func_31 (1);
  return 0;
}


-- 
   Summary: possible integer codegen error
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug middle-end/38572] [4.4 Regression] ICE in set_value_range, at tree-vrp.c:398

2009-01-21 Thread regehr at cs dot utah dot edu


--- Comment #25 from regehr at cs dot utah dot edu  2009-01-22 05:06 ---
I get this using r143561 on Ubuntu Hardy on x86:

reg...@john-home:~/volatile/tmp126$ current-gcc -O3 -c small.c 
small.c: In function ‘bar’:
small.c:22: internal compiler error: in set_value_range, at tree-vrp.c:398
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp126$ cat small.c

long long int foo (long long int si1, int si2)
{
  return 0 && 9223372036854775807LL - si2 || si1 < 0 && si2 < 0
&& si1 < -9223372036854775807LL - 1 - si2 ? : si1;
}

int g_11;
volatile int g_49;

int func_10 (void)
{
  for (g_11 = 1; 1;)
return 1;
}

int func_25 (void)
{
  int l_28 = 8L;
  return l_28;
}

void bar (int p_9)
{
  int l_146 = 4L;
  func_10 ();
  if (foo
  (p_9,
   ((signed char) (1 - (unsigned int) func_25 () | g_11) / l_146)))
g_49;
}


-- 


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



[Bug c/38926] New: ice in find_or_generate_expression, at tree-ssa-pre.c:2769

2009-01-20 Thread regehr at cs dot utah dot edu
Seen using r143537 on Ubuntu Hardy.

reg...@john-home:~/volatile/tmp123$ current-gcc -O3 small.c
small.c: In function ‘baz’:
small.c:59: internal compiler error: in find_or_generate_expression, at
tree-ssa-pre.c:2769
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
reg...@john-home:~/volatile/tmp123$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r143537-install
--program-prefix=r143537- --enable-languages=c,c++
Thread model: posix
gcc version 4.4.0 20090121 (experimental) (GCC) 
reg...@john-home:~/volatile/tmp123$ cat small.c
unsigned foo (int _si1, unsigned _si2)
{
  return _si1 > 0 && _si2 > 0 && _si1 > 2147483647 - _si2 && _si2;
}

signed char bar (signed char _left, int _right)
{
  return (unsigned int) _right >= 1 * 8 ? : _left >> _right;
}

unsigned g_2;
unsigned g_67;
unsigned g_111;
volatile unsigned g_162;

unsigned func_51 (unsigned p_53, unsigned p_55)
{
  return g_2;
}

int func_62 (unsigned p_63)
{
  p_63 = g_2 & g_67;
  if (g_2)
{
}
  else if (p_63)
return 1;
  g_67 = bar (p_63, func_51 (g_67, 1));
  return 0;
}

int func_57 (unsigned p_58)
{
  return func_62 (1);
}

int func_48 (unsigned p_49, unsigned p_50)
{
  return func_57 (1);
}

unsigned func_1 (void)
{
  unsigned l_5 = 0;
  if (g_2)
for (1; g_2 <= -16; g_2 = foo (g_2, 1))
  {
for (1; g_162; g_162)
  func_48 (func_48 (g_2, 1), l_5);
if (g_111)
  return 1;
  }
  return 0;
}

void crc32 (int);

void baz (void)
{
  func_1 ();
  crc32 (g_2);
}


-- 
   Summary: ice in find_or_generate_expression, at tree-ssa-
pre.c:2769
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38807] New: ice: gimple check: expected gimple_assign(error_mark), have gimple_phi()

2009-01-11 Thread regehr at cs dot utah dot edu
Seen using r143243 on Ubuntu Hardy on x86.

reg...@john-home:~/volatile/tmp121$ current-gcc -O2 small.c
small.c: In function ‘foo’:
small.c:16: internal compiler error: gimple check: expected
gimple_assign(error_mark), have gimple_phi() in gimple_assign_rhs1, at
gimple.h:1729
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp121$ cat small.c

int baz (short x)
{
  return x;
}

int g_2;
int g_10;

int bar (int p_7)
{
  if (baz (g_2 ^ p_7 ^ g_2))
return g_10;
  return 0;
}

int foo (void)
{
  return bar (g_2 == 0 || 1 == 1 - g_2) ? 1 : bar (1 && g_2);
}

reg...@john-home:~/volatile/tmp121$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion :
(reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20090110 (experimental) (GCC)


-- 
   Summary: ice: gimple check: expected gimple_assign(error_mark),
have gimple_phi()
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38774] New: ice in df_refs_verify, at df-scan.c:4307

2009-01-08 Thread regehr at cs dot utah dot edu
This is seen using r143187 on Ubuntu Hardy on x86.

PR 32431 reports a similar failure but at a different line number, and for the
68HC11 target.

reg...@john-home:~/volatile/tmp117$ current-gcc -c -O2 -march=i686 small.c
small.c: In function ‘foo’:
small.c:17: internal compiler error: in df_refs_verify, at df-scan.c:4307
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp117$ cat small.c

int safe_add_func_int64_t_s_s (int _si1, int _si2)
{
  return 1 > 9223372036854775807LL - _si2 && 1 - _si2 ? : 1 + _si2;
}

volatile int g_55;

void func_42 (int p_43, int p_44, int p_46, int p_47)
{
  p_44 & 1 && g_55, !1;
}

void foo (int p_38)
{
  int l_84 = 0;
  func_42 (1, safe_add_func_int64_t_s_s (p_38, 1 >= safe (1)), l_84, 1);
}

reg...@john-home:~/volatile/tmp117$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion :
(reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20090108 (experimental) (GCC)


-- 
   Summary: ice in df_refs_verify, at df-scan.c:4307
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38771] New: error: non-trivial conversion in unary operation

2009-01-08 Thread regehr at cs dot utah dot edu
Seen using r143187 on Ubuntu Hardy on x86.

reg...@john-home:~/volatile/tmp116$ current-gcc -O0 -c small.c
small.c: In function ‘foo’:
small.c:1: error: non-trivial conversion in unary operation
long long unsigned int
long long int
iftmp.0 = -p_37.1;

small.c:1: error: non-trivial conversion in unary operation
long long unsigned int
long long int
iftmp.0 = -p_37;

small.c:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp116$ cat small.c

unsigned long long foo (long long p_37)
{
  return -(unsigned long long) (p_37 ? : p_37);
}

reg...@john-home:~/volatile/tmp116$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion :
(reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20090108 (experimental) (GCC)


-- 
   Summary: error: non-trivial conversion in unary operation
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug rtl-optimization/37183] [4.4 Regression] ice in df_ref_chain_change_bb

2008-12-28 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2008-12-28 19:47 ---
(In reply to comment #1)
> Can you reproduce this now?

Nope-- looks fixed in r142939.


-- 


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



[Bug c/38590] New: ice: verify_gimple failed

2008-12-20 Thread regehr at cs dot utah dot edu
reg...@john-home:~/volatile/tmp83$ current-gcc -c -O2 -Wall small.c
small.c: In function ‘func_75’:
small.c:3: warning: statement with no effect
small.c:1: error: type mismatch in binary expression
int

int

unsigned int

D.1235 = -1 / p_76.1;

small.c:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

reg...@john-home:~/volatile/tmp83$ cat small.c

void func_75 (int p_76) 
{
  (1 / (int) -(unsigned int)p_76) < -1 ? 1 : p_76;
}

reg...@john-home:~/volatile/tmp83$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion :
(reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion : (reconfigured)
../configure --program-prefix=current- --prefix=/home/regehr
--enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20081220 (experimental) (GCC)


-- 
   Summary: ice: verify_gimple failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38364] -ftrapv triggers integer miscompilation

2008-12-01 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2008-12-02 03:46 ---
Bizarrely, deleting the unused func_53() makes the problem go away.


-- 


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



[Bug c/38364] New: -ftrapv triggers integer miscompilation

2008-12-01 Thread regehr at cs dot utah dot edu
Seen on Ubuntu Hardy using r142342.

[EMAIL PROTECTED]:~/volatile/tmp73$ current-gcc -O2 -Wall small.c -o small
[EMAIL PROTECTED]:~/volatile/tmp73$ ./small
0
[EMAIL PROTECTED]:~/volatile/tmp73$ current-gcc -O2 -ftrapv -Wall small.c -o
small
[EMAIL PROTECTED]:~/volatile/tmp73$ ./small
1
[EMAIL PROTECTED]:~/volatile/tmp73$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20081202 (experimental) (GCC) 
[EMAIL PROTECTED]:~/volatile/tmp73$ cat small.c
#include 
#include 

static inline int16_t
safe_mul_int16_t_s_s (int16_t si1, int16_t si2)
{
  if (si1 > 0)
{
  if (si2 > 0)
{
  if (si1 > ((32767) / si2))
{
  return si1;
}
}
  else
{
  if (si2 < ((-32767 - 1) / si1))
{
  return si1;
}
}
}
  else
{
  if (si2 > 0)
{
  if (si1 < ((-32767 - 1) / si2))
{
  return si1;
}
}
  else
{
  if ((si1 != 0) && (si2 < ((32767) / si1)))
{
  return si1;
}
}
}
  return si1 * si2;
}

static inline int8_t
safe_sub_int8_t_s_s (int8_t si1, int8_t si2)
{
  if (((si1 ^ si2) &
   (((si1 ^ ((si1 ^ si2) & (1 << (sizeof (int8_t) * 8 - 1 -
 si2) ^ si2)) < 0)
{
  return si1;
}
  return si1 - si2;
}

uint32_t g_38;

int32_t func_53 (int32_t p_54, uint32_t p_55);
int32_t func_53 (int32_t p_54, uint32_t p_55)
{
  safe_mul_int16_t_s_s (1, 1);
  return 1;
}

int32_t func_97 (uint16_t p_99);
int32_t func_97 (uint16_t p_99)
{
  g_38 = p_99;
  return 1;
}

int32_t func_120 (int32_t p_124);
int32_t func_120 (int32_t p_124)
{
  if (safe_sub_int8_t_s_s (p_124, 1))
safe_mul_int16_t_s_s (1, func_97 (1));
  return p_124;
}

int32_t func_14 (uint32_t p_16);
int32_t func_14 (uint32_t p_16)
{
  uint32_t l_438 = 0;
  func_97 (p_16 < (1 != func_120 (l_438)));
  return p_16;
}

int main (void)
{
  func_14 (1);
  printf ("%d\n", g_38);
  return 0;
}


-- 
   Summary: -ftrapv triggers integer miscompilation
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38281] New: ice: Segmentation fault

2008-11-26 Thread regehr at cs dot utah dot edu
Seen using r142231 on Ubuntu Hardy on x86.

[EMAIL PROTECTED]:~/volatile/tmp69$ current-gcc -O small.c
small.c: In function ‘func_41’:
small.c:22: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[EMAIL PROTECTED]:~/volatile/tmp69$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081126 (experimental) (GCC) 
[EMAIL PROTECTED]:~/volatile/tmp69$ cat small.c
typedef unsigned short int uint16_t;

inline uint16_t safe_div_uint16_t_u_u (uint16_t ui1, uint16_t ui2)
{
  if (ui2 == 0)
return ui1;
  return ui1 / ui2;
}

uint16_t g_223;
uint16_t g_243;
int g_252;

int func_41 (uint16_t p_42)
{
  int l_258 = 0;
  int l_261 = 0x3D75D162L;
  g_223 = safe_div_uint16_t_u_u (g_243 > l_261, func_110 (l_258, 1));
  for (g_252 = 0; g_252; g_252 = 1)
{
}
}


-- 
   Summary: ice: Segmentation fault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/38245] New: apparent improper segfault in compiler output

2008-11-23 Thread regehr at cs dot utah dot edu
This is seen using r142142 on Ubuntu Hardy on x86.

I don't think anything in the source code justifies the segfault.

[EMAIL PROTECTED]:~/volatile/tmp66$ current-gcc -O2 small.c -o small
[EMAIL PROTECTED]:~/volatile/tmp66$ ./small
Segmentation fault
[EMAIL PROTECTED]:~/volatile/tmp66$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081123 (experimental) (GCC) 

[EMAIL PROTECTED]:~/volatile/tmp66$ cat small.c

#include 
#include 

static inline int8_t

safe_sub_int8_t_s_s (int8_t si1, int8_t si2)
{
if (((si1^si2)
 & (((si1 ^ ((si1^si2)
 & (1 <<
(sizeof(int8_t)*CHAR_BIT-1-si2)^si2)) < 0) {
return si1;
}
return si1 - si2;
}

static inline int32_t
safe_div_int32_t_s_s (int32_t si1, int32_t si2)
{
if ((si2 == 0) || ((si1 == INT_MIN) && (si2 == -1))) {
return si1;
}   
return si1 / si2;
}   

static inline uint64_t  
safe_mod_uint64_t_u_u (uint64_t ui1, uint64_t ui2)
{   
if (ui2 == 0) return ui1;   
return ui1 % ui2;   
}   

uint8_t g_2;
volatile uint32_t g_9;

int32_t func_3 (void);
int32_t func_3 (void)
{
  return g_2;
}

void func_1 (void);
void func_1 (void)
{
  uint32_t l_10 = 0x084BL;
  if (safe_sub_int8_t_s_s
  ((safe_div_int32_t_s_s
(0, (safe_mod_uint64_t_u_u (func_3 (), l_10, 1))
{
}
  else if (g_9)
{
}
}

int main (void)
{
  func_1 ();
  return 0;
}


-- 
   Summary: apparent improper segfault in compiler output
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/35764] improper load from volatile

2008-11-15 Thread regehr at cs dot utah dot edu


--- Comment #2 from regehr at cs dot utah dot edu  2008-11-16 04:34 ---
I'm not sure what is going on, I get the same code as before using r141907 on
Ubuntu Hardy on x86.  What compiler options are you using and what platform?

[EMAIL PROTECTED]:~$ current-gcc -O -S vol.c -o -
.file   "vol.c"
.text
.globl foo
.type   foo, @function
foo:
pushl   %ebp
movl%esp, %ebp
subl$8, %esp
callbar
cmpl$1, %eax
sbbl%eax, %eax
andlg_156, %eax
leave
ret
.size   foo, .-foo
.comm   g_156,4,4
.ident  "GCC: (GNU) 4.4.0 20081116 (experimental)"
.section.note.GNU-stack,"",@progbits
[EMAIL PROTECTED]:~$ 
[EMAIL PROTECTED]:~$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081116 (experimental) (GCC) 
[EMAIL PROTECTED]:~$ 


-- 


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



[Bug c/37931] New: ice: verify_gimple failed

2008-10-27 Thread regehr at cs dot utah dot edu
[EMAIL PROTECTED]:~/volatile/tmp52$ current-gcc -O0 small.c
small.c: In function ‘func_1’:
small.c:5: error: type mismatch in binary expression
unsigned int

unsigned int

int

D.1241 = D.1240 & l_288;

small.c:5: error: type mismatch in binary expression
unsigned int

unsigned int

int

D.1242 = D.1241 | 1;

small.c:5: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[EMAIL PROTECTED]:~/volatile/tmp52$ cat small.c

unsigned int div_rhs (int rhs)
{
  return 0;
}

int func_1 (void)
{
  int g_268 = 0;
  int l_288 = 0;
  int l_266 = 0;
  return (l_288 | l_266 == l_266) & (div_rhs (1) | 1);
}

[EMAIL PROTECTED]:~/volatile/tmp52$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081027 (experimental) (GCC)


-- 
   Summary: ice: verify_gimple failed
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/37924] New: ice in smallest_mode_for_size, at stor-layout.c:219

2008-10-26 Thread regehr at cs dot utah dot edu
[EMAIL PROTECTED]:~/volatile/tmp51$ current-gcc -O small.c
small.c: In function ‘func_142’:
small.c:15: internal compiler error: in smallest_mode_for_size, at
stor-layout.c:219
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[EMAIL PROTECTED]:~/volatile/tmp51$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20081027 (experimental) (GCC) 

[EMAIL PROTECTED]:~/volatile/tmp51$ cat small.c

inline int
rshift_u_s (unsigned int left, int right)
{
  return left >> right;
}

char g_95;
const int g_126 = 9L;

int
func_142 (int p_143, int p_144, int p_145, int p_146)
{
  int l_152 = -1;
  if (lshift_u_u (func_26 (rshift_u_s (g_95 ^ l_152, g_126)), 1));
}


-- 
   Summary: ice in smallest_mode_for_size, at stor-layout.c:219
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug c/37709] cc1: out of memory

2008-10-01 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2008-10-01 23:42 ---
Created an attachment (id=16448)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16448&action=view)
failure-inducing input


-- 


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



[Bug c/37709] New: cc1: out of memory

2008-10-01 Thread regehr at cs dot utah dot edu
I don't know how much memory gcc is "supposed" to use but this seems
disproportionate. 

Seen on r140777 on Ubuntu Hardy.

Obviously the testcase itself is meaningless, but it is supposed to be free of
undefined behavior.  Before CPP it was about 37 kB.

[EMAIL PROTECTED]:~/volatile/tmp43$ current-gcc -Os -g foo.c
small2.c: In function ‘func_41’:
small2.c:309: warning: large integer implicitly truncated to unsigned type

cc1: out of memory allocating 268435456 bytes after a total of 29876224 bytes
[EMAIL PROTECTED]:~/volatile/tmp43$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20080930 (experimental) (GCC)


-- 
   Summary: cc1: out of memory
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



[Bug tree-optimization/37664] [4.4 Regression] ice in remove_range_assertions, at tree-vrp.c:5116

2008-09-29 Thread regehr at cs dot utah dot edu


--- Comment #5 from regehr at cs dot utah dot edu  2008-09-30 03:04 ---
(In reply to comment #3)
> The testcase is invalid, signed integer overflow is undefined behavior.

It still crashes when -fwrapv or -ftrapv is added to the command line.


-- 


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



[Bug c/37664] ice in remove_range_assertions, at tree-vrp.c:5116

2008-09-27 Thread regehr at cs dot utah dot edu


--- Comment #1 from regehr at cs dot utah dot edu  2008-09-27 19:00 ---
Slightly simpler testcase without the silly typecasts.

int lshift_u_u (int left, int right)
{
  if (right >= sizeof (int)  || left > 4294967295U >> right)
return left;
}

int mod_rhs (int rhs)
{
  return rhs;
}

int g_128;

int func_112 (int p_113, int p_115)
{
  func_116 (mod_rhs (lshift_u_u (g_128, (p_113 % mod_rhs (mod_rhs (p_113)
|| func_116 (1), 1);
}

int func_57 (int p_58)
{
  int l_59 = 0x8EL;
  func_37 ( func_60 (func_98 (1, l_59)), 1);
}

int func_98 (int p_99, int p_100)
{
  int l_114 = 0x8899A862L;
  func_101 ( lshift_u_u (func_112 (p_100 * l_114, 0), 1));
}


-- 


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



[Bug c/37664] New: ice in remove_range_assertions, at tree-vrp.c:5116

2008-09-27 Thread regehr at cs dot utah dot edu
Seen on r140721.

[EMAIL PROTECTED]:~/volatile/tmp46$ current-gcc -O3 small.c
small.c: In function ‘T.4’:
small.c:27: internal compiler error: in remove_range_assertions, at
tree-vrp.c:5116
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[EMAIL PROTECTED]:~/volatile/tmp46$ cat small.c

typedef int int16_t;
typedef int int32_t;
typedef int uint32_t;

int lshift_u_u (int left, int right)
{
  if (right >= sizeof (int) * 8 || left > 4294967295U >> right)
return left;
}

int mod_rhs (int rhs)
{
  return rhs;
}

uint32_t g_128;

uint32_t func_112 (int32_t p_113, uint32_t p_115);

uint32_t func_57 (int16_t p_58)
{
  uint32_t l_59 = 0x8EL;
  func_37 (l_59, func_60 (func_98 (1, l_59)), 1);
}

uint32_t func_98 (uint32_t p_99, uint32_t p_100)
{
  uint32_t l_111;
  uint32_t l_114 = 0x8899A862L;
  func_101 (l_111, lshift_u_u (func_112 (p_100 * l_114, 0), -1));
}

uint32_t func_112 (int32_t p_113, uint32_t p_115)
{
  func_116 (mod_rhs (lshift_u_u (g_128, (p_113 % mod_rhs (mod_rhs (p_113)
|| func_116 (1, 1), 1);
}

[EMAIL PROTECTED]:~/volatile/tmp46$ current-gcc -v

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr :
(reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++
--prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion : (reconfigured) ../configure
--program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++
--no-create --no-recursion
Thread model: posix
gcc version 4.4.0 20080927 (experimental) (GCC)


-- 
   Summary: ice in remove_range_assertions, at tree-vrp.c:5116
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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



  1   2   >