User account creation filtered due to spam.

Bug 47139 - [4.6 Regression] ice in process_use, at tree-vect-stmts.c:290
Summary: [4.6 Regression] ice in process_use, at tree-vect-stmts.c:290
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P1 normal
Target Milestone: 4.6.0
Assignee: Ira Rosen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-01 01:26 UTC by John Regehr
Modified: 2011-01-06 07:35 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.2
Known to fail: 4.6.0
Last reconfirmed: 2011-01-01 11:36:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2011-01-01 01:26:39 UTC
[regehr@gamow tmp433]$ current-gcc -O3 small.c -c

small.c: In function 'func_1':
small.c:19:1: internal compiler error: in process_use, at tree-vect-stmts.c:290
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp433]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168380-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-r168380-install --program-prefix=r168380- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20101231 (experimental) (GCC) 

[regehr@gamow tmp433]$ cat small.c

typedef signed char int8_t;
typedef int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
static uint8_t
safe_add_func_uint32_t_u_u (uint32_t ui1, uint8_t ui2)
{
  return ui1 + ui2;
}

int32_t g_10;
int32_t *g_23 = &g_10;
int32_t **const volatile g = &g_23;
int32_t g_42;
int32_t *func_68 (uint16_t p_69, int8_t p_70);

uint8_t
func_1 (void)
{
  *g = func_68 (0x837BL, 0);
  return 0;
}

int32_t *
func_68 (uint16_t p_69, int8_t p_70)
{
  int32_t l_113;
  for (p_70 = 1; p_70; p_70 = safe_add_func_uint32_t_u_u (p_70, 1))
    {
      int32_t *l_118 = &g_42;
      *l_118 = l_113;
      l_113 |= p_70;
    }
  return 0;
}

int
main (int argc, char *argv[])
{
  func_1 ();
  return 0;
}
Comment 1 Jakub Jelinek 2011-01-01 11:36:12 UTC
Simplified testcase:
int d;

void
foo ()
{
  int a = 0;
  unsigned char b;
  for (b = 1; b; b++)
    {
      d = a;
      a |= b;
    }
}
Comment 2 Jakub Jelinek 2011-01-01 12:28:45 UTC
Introduced by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158018
Comment 3 Ira Rosen 2011-01-04 11:58:35 UTC
This shouldn't be recognized as reduction, because the value of the one before last iteration is used outside the loop. I'll add this check to reduction detection.

Ira
Comment 4 irar 2011-01-06 07:34:28 UTC
Author: irar
Date: Thu Jan  6 07:34:24 2011
New Revision: 168535

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168535
Log:

        PR tree-optimization/47139
        * tree-vect-loop.c (vect_is_simple_reduction_1): Check that 
        only the last reduction value is used outside the loop. Update
        documentation.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr47139.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c
Comment 5 Ira Rosen 2011-01-06 07:35:45 UTC
Fixed.