Bug 34769 - [4.3 Regression] gcc.dg/vect/no-vfa-pr29145.c
Summary: [4.3 Regression] gcc.dg/vect/no-vfa-pr29145.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Richard Biener
URL:
Keywords: wrong-code
Depends on:
Blocks: 34458
  Show dependency treegraph
 
Reported: 2008-01-13 15:35 UTC by H.J. Lu
Modified: 2008-01-16 20:01 UTC (History)
3 users (show)

See Also:
Host:
Target: i?86-*-* (HWI64)
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-01-16 14:38:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-01-13 15:35:56 UTC
On Linux/Intel64, with revision 131442, I got

Executing on host: /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ /export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c   -ftree-vectorize -fno-vect-cost-model -msse2 -O2 -fdump-tree-vect-details --param vect-max-version-for-alias-checks=0 -fno-show-column  -lm   -m32 -o ./no-vfa-pr29145.exe    (timeout = 300)
PASS: gcc.dg/vect/no-vfa-pr29145.c (test for excess errors)
FAIL: gcc.dg/vect/no-vfa-pr29145.c execution test
FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 0 loops" 2
FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 1 loops" 1

Revision 131403 is OK.
Comment 1 H.J. Lu 2008-01-13 16:25:16 UTC
Revision 131429:

http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00367.html
Comment 2 H.J. Lu 2008-01-13 16:26:11 UTC
Revision 131429 is the cause.
Comment 3 H.J. Lu 2008-01-13 16:31:46 UTC
This bug may only happen when you compile for 32bit on 64bit host.
Comment 4 Richard Biener 2008-01-13 16:45:47 UTC
It simply vectorizes all loops in the testcase.  It looks like there may be a
non-canonical sizetype constant (just wild guesses).
Comment 5 Richard Biener 2008-01-13 17:00:03 UTC
We enter that function with:

{4294967288B, +, 4}_1

 <polynomial_chrec 0x2acbda7bd500
    type <pointer_type 0x2acbd9dd09c0
        type <integer_type 0x2acbd9dc1540 int sizes-gimplified public SI
            size <integer_cst 0x2acbd9db1ab0 constant invariant 32>
            unit size <integer_cst 0x2acbd9db1720 constant invariant 4>
            align 32 symtab 0 alias set 2 canonical type 0x2acbd9dc1540 precision 32 min <integer_cst 0x2acbd9db1a20 -2147483648> max <integer_cst 0x2acbd9db1a50 2147483647>
            pointer_to_this <pointer_type 0x2acbd9dd09c0>>
        sizes-gimplified public unsigned SI size <integer_cst 0x2acbd9db1ab0 32> unit size <integer_cst 0x2acbd9db1720 4>
        align 32 symtab 0 alias set -1 canonical type 0x2acbd9dd09c0>
   
    arg 0 <integer_cst 0x2acbd9dce510 type <integer_type 0x2acbd9dc1540 int> constant invariant 1>
    arg 1 <integer_cst 0x2acbda7bf4b0 type <pointer_type 0x2acbd9dd09c0> constant invariant public overflow 4294967288> arg 2 <integer_cst 0x2acbd9db1720 4>>

where the HOST_WIDE_INT will be positive (it's not sign-extended).


For -m64 we instead get

{-8B, +, 4}_1

 <polynomial_chrec 0x2b154a2925f0
    type <pointer_type 0x2b15498a3b40
        type <integer_type 0x2b1549894540 int sizes-gimplified public SI
            size <integer_cst 0x2b1549884ab0 constant invariant 32>
            unit size <integer_cst 0x2b1549884720 constant invariant 4>
            align 32 symtab 0 alias set 2 canonical type 0x2b1549894540 precision 32 min <integer_cst 0x2b1549884a20 -2147483648> max <integer_cst 0x2b1549884a50 2147483647>
            pointer_to_this <pointer_type 0x2b15498a3b40>>
        sizes-gimplified public unsigned DI
        size <integer_cst 0x2b1549884ba0 constant invariant 64>
        unit size <integer_cst 0x2b1549884bd0 constant invariant 8>
        align 64 symtab 0 alias set -1 canonical type 0x2b15498a3b40>
   
    arg 0 <integer_cst 0x2b15498a1570 type <integer_type 0x2b1549894540 int> constant invariant 1>
    arg 1 <integer_cst 0x2b154a2948a0 type <pointer_type 0x2b15498a3b40> constant invariant public overflow 18446744073709551608> arg 2 <integer_cst 0x2b1549884720 4>>

where the HOST_WIDE_INT will be negative.


For consistency you should always use sizetype variables for offsets, as
they are properly sign-extended.  Using pointer types asks for trouble.
Comment 6 Richard Biener 2008-01-16 14:38:35 UTC
Mine.
Comment 7 Richard Biener 2008-01-16 16:01:03 UTC
Subject: Bug 34769

Author: rguenth
Date: Wed Jan 16 16:00:17 2008
New Revision: 131573

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131573
Log:
2008-01-16  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/34769
	* tree-data-ref.c (initialize_matrix_A): Revert fix for PR34458.
	* tree.c (int_cst_value): Instead make this function more
	permissive in what it accepts as valid input.  Document this
	function always sign-extends the value.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree.c

Comment 8 Richard Biener 2008-01-16 20:01:45 UTC
Fixed.