[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-12-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

--- Comment #5 from Martin Sebor  ---
Author: msebor
Date: Fri Dec  6 00:18:32 2019
New Revision: 279029

URL: https://gcc.gnu.org/viewcvs?rev=279029=gcc=rev
Log:
PR middle-end/92622 - FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing
warnings for VLA on lines 67 and 69

gcc/ChangeLog:

PR middle-end/92622
* tree-vrp.c (vrp_prop::check_array_ref): Avoid using a variable
left uninitialized by get_addr_base_and_unit_offset ofn failure.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vrp.c

[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-12-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

Martin Sebor  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

--- Comment #4 from Martin Sebor  ---
I think I see the problem.  It's due to the use of an uninitialized variable.
The patch below fixes it:

Index: gcc/tree-vrp.c
===
--- gcc/tree-vrp.c  (revision 279008)
+++ gcc/tree-vrp.c  (working copy)
@@ -3544,7 +3544,7 @@ vrp_prop::check_array_ref (location_t location, tr
  decl = base;
}

- if (known_gt (off, 0))
+ if (base && known_gt (off, 0))
maxbound = wide_int_to_tree (sizetype,
 wi::sub (wi::to_wide (maxbound),
  off));

[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-12-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

--- Comment #3 from Martin Sebor  ---
The reduced test case below reproduces the spurious nature of the failure
outside the test harness:

$ (set -x; cat t.c && for i in 1 2 3; do gcc -O2 -S -Warray-bounds
-ftrack-macro-expansion=0 -m32 t.c ; done)
+ cat t.c
#define DIFF_MAX __PTRDIFF_MAX__
#define DIFF_MIN (-DIFF_MAX - 1)

void f (int);

void g (unsigned m, unsigned n)
{
  char a[m][n];

  f (a[0][DIFF_MAX]); 
}

+ for i in 1 2 3
+ gcc -O2 -S -Warray-bounds -ftrack-macro-expansion=0 -m32 t.c
t.c: In function ‘g’:
t.c:10:10: warning: array subscript 2147483647 is above array bounds of
‘char[ + 1]’ [-Warray-bounds]
   10 |   f (a[0][DIFF_MAX]);
  |  ^~
+ for i in 1 2 3
+ gcc -O2 -S -Warray-bounds -ftrack-macro-expansion=0 -m32 t.c
+ for i in 1 2 3
+ gcc -O2 -S -Warray-bounds -ftrack-macro-expansion=0 -m32 t.c
$

[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-12-01 Thread sandra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

sandra at gcc dot gnu.org changed:

   What|Removed |Added

 CC||sandra at gcc dot gnu.org

--- Comment #2 from sandra at gcc dot gnu.org ---
I've been seeing this random failure on nios2-elf and nios2-linux-gnu, too.

[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-11-26 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

--- Comment #1 from Martin Sebor  ---
The failure doesn't seem to be reliably reproducible.  Of the three times the
script below runs the test it fails just once.

$ for i in 1 2 3; do nice time make -C /build/gcc-git-svn/gcc check-c 
'CFLAGS=-O0 -g3' 'CXXFLAGS=-O0 -g3' 'STAGE1_CFLAGS=-O0 -g3'
'STAGE1_CXXFLAGS=-O0 -g3' RUNTESTFLAGS="dg.exp=Warray-bounds-22.c
--target_board=unix/-m32"; done
make: Entering directory '/ssd/build/gcc-git-svn/gcc'
rm -rf testsuite/gcc-parallel
make[1]: Entering directory '/ssd/build/gcc-git-svn/gcc'
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd /src/gcc/git-svn/gcc; ${PWDCMD-pwd}` ; export srcdir ; \
if [ -n "" ] \
   && [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] \
   && [ -f testsuite/gcc-parallel/finished ]; then \
  rm -rf testsuite/gcc; \
else \
  cd testsuite/gcc; \
  rm -f tmp-site.exp; \
  sed '/set tmpdir/ s|testsuite$|testsuite/gcc|' \
< ../../site.exp > tmp-site.exp; \
  /bin/sh ${srcdir}/../move-if-change tmp-site.exp site.exp; \
  EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ; \
  if [ -f ${rootme}/../expect/expect ] ; then  \
TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
export TCL_LIBRARY ; \
  fi ; \
  `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool gcc
dg.exp=Warray-bounds-22.c --target_board=unix/-m32; \
  if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
touch ${rootme}/testsuite/gcc-parallel/finished; \
  fi ; \
fi )
WARNING: Couldn't find the global config file.
Test run by msebor on Tue Nov 26 15:39:30 2019
Native configuration is x86_64-pc-linux-gnu

=== gcc tests ===

Schedule of variations:
unix/-m32

Running target unix/-m32
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /src/gcc/git-svn/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /src/gcc/git-svn/gcc/testsuite/gcc.dg/dg.exp ...

=== gcc Summary ===

# of expected passes15
# of expected failures  8
/ssd/build/gcc-git-svn/gcc/xgcc  version 10.0.0 20191126 (experimental) (GCC) 

make[1]: Leaving directory '/ssd/build/gcc-git-svn/gcc'
make: Leaving directory '/ssd/build/gcc-git-svn/gcc'
0.63user 0.14system 0:00.94elapsed 83%CPU (0avgtext+0avgdata 39292maxresident)k
0inputs+128outputs (0major+60721minor)pagefaults 0swaps
make: Entering directory '/ssd/build/gcc-git-svn/gcc'
rm -rf testsuite/gcc-parallel
make[1]: Entering directory '/ssd/build/gcc-git-svn/gcc'
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd /src/gcc/git-svn/gcc; ${PWDCMD-pwd}` ; export srcdir ; \
if [ -n "" ] \
   && [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] \
   && [ -f testsuite/gcc-parallel/finished ]; then \
  rm -rf testsuite/gcc; \
else \
  cd testsuite/gcc; \
  rm -f tmp-site.exp; \
  sed '/set tmpdir/ s|testsuite$|testsuite/gcc|' \
< ../../site.exp > tmp-site.exp; \
  /bin/sh ${srcdir}/../move-if-change tmp-site.exp site.exp; \
  EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ; \
  if [ -f ${rootme}/../expect/expect ] ; then  \
TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \
export TCL_LIBRARY ; \
  fi ; \
  `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool gcc
dg.exp=Warray-bounds-22.c --target_board=unix/-m32; \
  if [ -n "$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
touch ${rootme}/testsuite/gcc-parallel/finished; \
  fi ; \
fi )
WARNING: Couldn't find the global config file.
Test run by msebor on Tue Nov 26 15:39:31 2019
Native configuration is x86_64-pc-linux-gnu

=== gcc tests ===

Schedule of variations:
unix/-m32

Running target unix/-m32
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /src/gcc/git-svn/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /src/gcc/git-svn/gcc/testsuite/gcc.dg/dg.exp ...
FAIL: gcc.dg/Warray-bounds-22.c vla (test for warnings, line 67)
FAIL: gcc.dg/Warray-bounds-22.c vla (test for warnings, line 69)

=== gcc Summary ===

# of expected passes13
# of unexpected failures2
# of expected failures  8
/ssd/build/gcc-git-svn/gcc/xgcc  version 10.0.0 20191126 (experimental) (GCC) 

make[1]: Leaving directory '/ssd/build/gcc-git-svn/gcc'
make: Leaving directory '/ssd/build/gcc-git-svn/gcc'
0.65user 0.13system 0:00.94elapsed 83%CPU (0avgtext+0avgdata 39368maxresident)k
0inputs+128outputs (0major+60706minor)pagefaults 0swaps
make: Entering directory 

[Bug testsuite/92622] FAIL: gcc.dg/Warray-bounds-22.c on ILP32: missing warnings for VLA on lines 67 and 69

2019-11-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92622

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-11-21
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1