public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
@ 2021-07-08  7:43 rguenth at gcc dot gnu.org
  2021-07-08  7:44 ` [Bug bootstrap/101374] " rguenth at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  7:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

            Bug ID: 101374
           Summary: [12 Regression] bootstrap failure varpool.c:490:19:
                    error: array subscript 'varpool_node[0]' is partly
                    outside array bounds of 'varpool_node [0]'
                    [-Werror=array-bounds]
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

Bootstrap fails for me with

/home/rguenther/src/trunk/gcc/varpool.c:490:19: error: array subscript
'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]'
[-Werror=array-bounds]
  490 |   if (!definition && !in_other_partition)
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/rguenther/src/trunk/gcc/varpool.c:29:
/home/rguenther/src/trunk/gcc/cgraph.h: In member function 'availability
varpool_node::_ZN12varpool_node16get_availabilityEP11symtab_node.part.0(symtab_node*)':
/home/rguenther/src/trunk/gcc/cgraph.h:1969:39: note: object
'varpool_node::<anonymous>' of size 120
 1969 | struct GTY((tag ("SYMTAB_VARIABLE"))) varpool_node : public symtab_node
      |                                       ^~~~~~~~~~~~

when in stage2.

configure --enable-languages=c++,obj-c++
make -j24 STAGE1_CFLAGS="-O2"

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
@ 2021-07-08  7:44 ` rguenth at gcc dot gnu.org
  2021-07-08  7:48 ` rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  7:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
           Keywords|                            |diagnostic
             Target|                            |x86_64-*-*
   Target Milestone|---                         |12.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
  2021-07-08  7:44 ` [Bug bootstrap/101374] " rguenth at gcc dot gnu.org
@ 2021-07-08  7:48 ` rguenth at gcc dot gnu.org
  2021-07-08  8:50 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  7:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Reverting g:a110855667782dac7b674d3e328b253b3b3c919b gets me past this failure
point.

I'll note the printed location is bogus as well, it points to

/* Return variable availability.  See cgraph.h for description of individual
   return values.  */
enum availability
varpool_node::get_availability (symtab_node *ref)
{
  if (!definition && !in_other_partition)   <----
    return AVAIL_NOT_AVAILABLE;
  if (!TREE_PUBLIC (decl))

it might eventually warn on this->definition though?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
  2021-07-08  7:44 ` [Bug bootstrap/101374] " rguenth at gcc dot gnu.org
  2021-07-08  7:48 ` rguenth at gcc dot gnu.org
@ 2021-07-08  8:50 ` rguenth at gcc dot gnu.org
  2021-07-08  9:22 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  8:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm reducing a testcase for the varpool.c warning.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-08  8:50 ` rguenth at gcc dot gnu.org
@ 2021-07-08  9:22 ` rguenth at gcc dot gnu.org
  2021-07-08  9:26 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  9:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following fails with -O2 -Wall -Werror after but not before the rev. - not
sure if the reduction is otherwise sensible.

template <typename T> struct reinterpret_is_a_helper {
  template <typename U> static T cast(U p) { return T(p); }
};
template <typename, typename U> bool is_a(U);
template <typename T, typename U> T dyn_cast(U p) {
  if (is_a<T>(p))
    return reinterpret_is_a_helper<T>::cast(p);
  return 0;
}
enum tree_node_structure_enum { TS_DECL_COMMON };
void contains_struct_check(int, tree_node_structure_enum, const char *, int,
                           const char *);
enum availability { AVAIL_NOT_AVAILABLE, AVAIL_AVAILABLE };
struct symtab_node {
  symtab_node *ultimate_alias_target();
  unsigned definition : 1;
  unsigned in_other_partition : 1;
};
struct varpool_node : symtab_node {
  availability get_availability();
  varpool_node *ultimate_alias_target(symtab_node *);
  unsigned : 1;
};
inline symtab_node *symtab_node::ultimate_alias_target() {
  dyn_cast<varpool_node *>(this)->get_availability();
  dyn_cast<varpool_node *>(this)->get_availability();
  return 0;
}
inline varpool_node *varpool_node::ultimate_alias_target(symtab_node *) {
  symtab_node __trans_tmp_1 = *symtab_node::ultimate_alias_target();
  varpool_node *n = dyn_cast<varpool_node *>(&__trans_tmp_1);
  return n;
}
availability varpool_node::get_availability() {
  symtab_node ref;
  if (definition && in_other_partition)
    return AVAIL_NOT_AVAILABLE;
  ultimate_alias_target(&ref);
  contains_struct_check(0, TS_DECL_COMMON, "", 5, __FUNCTION__);
  return AVAIL_AVAILABLE;
}

> /tmp/obj2/prev-gcc/cc1plus -quiet varpool.ii -O2 -Wall -Werror 
In member function 'availability varpool_node::get_availability()',
    inlined from 'symtab_node* symtab_node::ultimate_alias_target()' at
varpool.ii:25:51,
    inlined from 'varpool_node*
varpool_node::ultimate_alias_target(symtab_node*)' at varpool.ii:30:66,
    inlined from 'availability
varpool_node::_ZN12varpool_node16get_availabilityEv.part.0()' at
varpool.ii:38:24:
varpool.ii:36:18: error: array subscript 'varpool_node[0]' is partly outside
array bounds of 'varpool_node [0]' [-Werror=array-bounds]
   36 |   if (definition && in_other_partition)
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
varpool.ii: In member function 'availability
varpool_node::_ZN12varpool_node16get_availabilityEv.part.0()':
varpool.ii:19:8: note: object 'varpool_node::<anonymous>' of size 4
   19 | struct varpool_node : symtab_node {
      |        ^~~~~~~~~~~~
In member function 'availability varpool_node::get_availability()',
    inlined from 'symtab_node* symtab_node::ultimate_alias_target()' at
varpool.ii:26:51,
    inlined from 'varpool_node*
varpool_node::ultimate_alias_target(symtab_node*)' at varpool.ii:30:66,
    inlined from 'availability
varpool_node::_ZN12varpool_node16get_availabilityEv.part.0()' at
varpool.ii:38:24:
varpool.ii:36:18: error: array subscript 'varpool_node[0]' is partly outside
array bounds of 'varpool_node [0]' [-Werror=array-bounds]
   36 |   if (definition && in_other_partition)
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
varpool.ii: In member function 'availability
varpool_node::_ZN12varpool_node16get_availabilityEv.part.0()':
varpool.ii:19:8: note: object 'varpool_node::<anonymous>' of size 4
   19 | struct varpool_node : symtab_node {
      |        ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-07-08  9:22 ` rguenth at gcc dot gnu.org
@ 2021-07-08  9:26 ` rguenth at gcc dot gnu.org
  2021-07-08 10:46 ` schwab@linux-m68k.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-08  9:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Little bit less undefined - reconstructed the original symtab_node *ref
argument of get_availability.  Maybe we're confused about the upcast to
varpool_node?

template <typename T> struct reinterpret_is_a_helper {
  template <typename U> static T cast(U p) { return T(p); }
};
template <typename, typename U> bool is_a(U);
template <typename T, typename U> T dyn_cast(U p) {
  if (is_a<T>(p))
    return reinterpret_is_a_helper<T>::cast(p);
  return 0;
}
enum tree_node_structure_enum { TS_DECL_COMMON };
void contains_struct_check(int, tree_node_structure_enum, const char *, int,
                           const char *);
enum availability { AVAIL_NOT_AVAILABLE, AVAIL_AVAILABLE };
struct symtab_node {
  symtab_node *ultimate_alias_target();
  unsigned definition : 1;
  unsigned in_other_partition : 1;
};
struct varpool_node : symtab_node {
  availability get_availability(symtab_node *);
  varpool_node *ultimate_alias_target(symtab_node *);
  unsigned : 1;
};
inline symtab_node *symtab_node::ultimate_alias_target() {
  dyn_cast<varpool_node *>(this)->get_availability(this);
  dyn_cast<varpool_node *>(this)->get_availability(this);
  return 0;
}
inline varpool_node *varpool_node::ultimate_alias_target(symtab_node *) {
  symtab_node __trans_tmp_1 = *symtab_node::ultimate_alias_target();
  varpool_node *n = dyn_cast<varpool_node *>(&__trans_tmp_1);
  return n;
}
availability varpool_node::get_availability(symtab_node *ref) {
  if (definition && in_other_partition)
    return AVAIL_NOT_AVAILABLE;
  ultimate_alias_target(ref);
  contains_struct_check(0, TS_DECL_COMMON, "", 5, __FUNCTION__);
  return AVAIL_AVAILABLE;
}

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-07-08  9:26 ` rguenth at gcc dot gnu.org
@ 2021-07-08 10:46 ` schwab@linux-m68k.org
  2021-07-08 14:47 ` schwab@linux-m68k.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: schwab@linux-m68k.org @ 2021-07-08 10:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> ---
*** Bug 101372 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-07-08 10:46 ` schwab@linux-m68k.org
@ 2021-07-08 14:47 ` schwab@linux-m68k.org
  2021-07-08 14:47 ` schwab@linux-m68k.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: schwab@linux-m68k.org @ 2021-07-08 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-*-*                  |

--- Comment #6 from Andreas Schwab <schwab@linux-m68k.org> ---
Broken everywhere.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-07-08 14:47 ` schwab@linux-m68k.org
@ 2021-07-08 14:47 ` schwab@linux-m68k.org
  2021-07-08 14:49 ` msebor at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: schwab@linux-m68k.org @ 2021-07-08 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clyon at gcc dot gnu.org

--- Comment #7 from Andreas Schwab <schwab@linux-m68k.org> ---
*** Bug 101379 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-07-08 14:47 ` schwab@linux-m68k.org
@ 2021-07-08 14:49 ` msebor at gcc dot gnu.org
  2021-07-08 15:47 ` msebor at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-08 14:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org
   Last reconfirmed|                            |2021-07-08

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the reduced test case!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-07-08 14:49 ` msebor at gcc dot gnu.org
@ 2021-07-08 15:47 ` msebor at gcc dot gnu.org
  2021-07-08 17:44 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-08 15:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
For the test case the warning sees this:

int varpool_node::_ZN12varpool_node16get_availabilityEv.part.0 (struct
varpool_node * const this)
{
  ...
  struct symtab_node * _7;
  struct varpool_node * _12;
  ...
  <bb 2> [local count: 1073741824]:
  _7 = &this_1(D)->D.2395;            <<< varpool_node::symtab_node subobject
  _11 = is_a<varpool_node*, symtab_node*> (_7);
  if (_11 != 0)
    goto <bb 4>; [71.00%]
  else
    goto <bb 3>; [29.00%]

  <bb 3> [local count: 311385128]:

  <bb 4> [local count: 1073741824]:
  # _12 = PHI <_7(2), 0B(3)>          <<< _12 size is (at most) 4
  _15 = BIT_FIELD_REF <*_12, 8, 0>;   <<< -Warray-bounds

The MEM_REF *_12 accesses a varpool_node object with size 8 but _12 points to a
symtab_node subobject with size of just 4.  So the warning code works
correctly.  It triggers because the call to compute_objsize(..., 1, ...) (with
Object Size Type 1) respects subobject boundaries and so doesn't consider that
_12, or more precisely _7, points to a subobject of a larger object.  Before
r12-2132 -Warray-bounds did its own slightly more conservative computation
which was roughly equivalent to Object Size Type 0.

Calling compute_objsize(..., 0, ...) instead avoids the warning for the reduced
test case.  Let me see if it also fixes the rest of the problems.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-07-08 15:47 ` msebor at gcc dot gnu.org
@ 2021-07-08 17:44 ` cvs-commit at gcc dot gnu.org
  2021-07-08 18:04 ` msebor at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-08 17:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:9bf9f27ac6db4823628c435da9b242fd82bf8d68

commit r12-2171-g9bf9f27ac6db4823628c435da9b242fd82bf8d68
Author: Martin Sebor <msebor@redhat.com>
Date:   Thu Jul 8 11:34:27 2021 -0600

    Use Object Size Type zero for -Warray-bounds [PR101374].

    Resolves:
    PR bootstrap/101374 - -Warray-bounds accessing a member subobject as
derived

    gcc/cp/ChangeLog:
            PR bootstrap/101374
            * module.cc (module_state::read_macro_maps): Temporarily disable
            -Warray-bounds.
            (module_state::install_macros): Same.

    gcc/ChangeLog:
            PR bootstrap/101374
            * gimple-array-bounds.cc (array_bounds_checker::check_mem_ref):
            Use Object Size Type 0 instead of 1.

    gcc/testsuite/ChangeLog:
            PR bootstrap/101374
            * c-c++-common/Warray-bounds-3.c: Xfail assertion.
            * c-c++-common/Warray-bounds-4.c: Same.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-07-08 17:44 ` cvs-commit at gcc dot gnu.org
@ 2021-07-08 18:04 ` msebor at gcc dot gnu.org
  2021-07-08 21:20 ` bergner at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-08 18:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #11 from Martin Sebor <msebor at gcc dot gnu.org> ---
r12-2171 unblocks bootstrap on x86_64.  I'll leave this open in case there's
still more fallout.

Go currently doesn't bootstrap due to a valid -Warray-bounds triggered also by
r12-2132.  I sent the patch below to Ian:
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574752.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-07-08 18:04 ` msebor at gcc dot gnu.org
@ 2021-07-08 21:20 ` bergner at gcc dot gnu.org
  2021-07-08 22:13 ` msebor at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-07-08 21:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #11)
> r12-2171 unblocks bootstrap on x86_64.

My bootstrap on powerpc64le-linux completes now too.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-07-08 21:20 ` bergner at gcc dot gnu.org
@ 2021-07-08 22:13 ` msebor at gcc dot gnu.org
  2021-07-10  2:49 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-08 22:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #13 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the confirmation!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2021-07-08 22:13 ` msebor at gcc dot gnu.org
@ 2021-07-10  2:49 ` cvs-commit at gcc dot gnu.org
  2021-07-13 16:10 ` msebor at gcc dot gnu.org
  2021-07-16 16:33 ` abidh at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-10  2:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>:

https://gcc.gnu.org/g:1798cac7a8b3331a277da1f106752ce0a34f8937

commit r12-2234-g1798cac7a8b3331a277da1f106752ce0a34f8937
Author: Ian Lance Taylor <iant@golang.org>
Date:   Thu Jul 8 19:25:55 2021 -0700

    runtime: remove direct assignments to memory locations

    PR bootstrap/101374
    They cause a warning with the updated GCC -Warray-bounds option.
    Replace them with calls to abort, which for our purposes is fine.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/333409

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2021-07-10  2:49 ` cvs-commit at gcc dot gnu.org
@ 2021-07-13 16:10 ` msebor at gcc dot gnu.org
  2021-07-16 16:33 ` abidh at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-13 16:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #15 from Martin Sebor <msebor at gcc dot gnu.org> ---
Fixed by r12-2171; Go fixed by r12-2234.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug bootstrap/101374] [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds]
  2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2021-07-13 16:10 ` msebor at gcc dot gnu.org
@ 2021-07-16 16:33 ` abidh at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: abidh at gcc dot gnu.org @ 2021-07-16 16:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101374

Hafiz Abid qadeer <abidh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abidh at gcc dot gnu.org

--- Comment #16 from Hafiz Abid qadeer <abidh at gcc dot gnu.org> ---
Similar problem in libgomp and it is still broken. I was building for x86_64
with amdgcn offloading.

/scratch/cfi/x86_64-linux-gnu-amdgcn/obj/accel-gcc-mainline/./gcc/xgcc
-B/scratch/cfi/x86_64-linux-gnu-amdgcn/obj/accel-gcc-mainline/./gcc/
-B/scratch/cfi/x86_64-linux-gnu-amdgcn/install/amdgcn-amdhsa/bin/
-B/scratch/cfi/x86_64-linux-gnu-amdgcn/install/amdgcn-amdhsa/lib/ -isystem
/scratch/cfi/x86_64-linux-gnu-amdgcn/install/amdgcn-amdhsa/include -isystem
/scratch/cfi/x86_64-linux-gnu-amdgcn/install/amdgcn-amdhsa/sys-include   
-DHAVE_CONFIG_H -I.
-I/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp 
-I/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/config/gcn
-I/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/config/accel
-I/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp
-I/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/../include 
-Wall -Werror  -g -O2 -MT barrier.lo -MD -MP -MF .deps/barrier.Tpo -c -o
barrier.lo
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/barrier.c
In file included from
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/barrier.c:28:
In function 'gcn_thrs',
    inlined from 'gomp_thread' at
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/libgomp.h:803:10,
    inlined from 'GOMP_barrier' at
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/barrier.c:34:29:
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/libgomp.h:792:10:
error: array subscript 0 is outside array bounds of '__lds struct gomp_thread *
__lds[0]' [-Werror=array-bounds]
  792 |   return *thrs;
      |          ^~~~~
In function 'gcn_thrs',
    inlined from 'gomp_thread' at
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/libgomp.h:803:10,
    inlined from 'GOMP_barrier_cancel' at
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/barrier.c:47:29:
/scratch/cfi/x86_64-linux-gnu-amdgcn/src/gcc-mainline/libgomp/libgomp.h:792:10:
error: array subscript 0 is outside array bounds of '__lds struct gomp_thread *
__lds[0]' [-Werror=array-bounds]
  792 |   return *thrs;
      |          ^~~~~

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-07-16 16:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  7:43 [Bug bootstrap/101374] New: [12 Regression] bootstrap failure varpool.c:490:19: error: array subscript 'varpool_node[0]' is partly outside array bounds of 'varpool_node [0]' [-Werror=array-bounds] rguenth at gcc dot gnu.org
2021-07-08  7:44 ` [Bug bootstrap/101374] " rguenth at gcc dot gnu.org
2021-07-08  7:48 ` rguenth at gcc dot gnu.org
2021-07-08  8:50 ` rguenth at gcc dot gnu.org
2021-07-08  9:22 ` rguenth at gcc dot gnu.org
2021-07-08  9:26 ` rguenth at gcc dot gnu.org
2021-07-08 10:46 ` schwab@linux-m68k.org
2021-07-08 14:47 ` schwab@linux-m68k.org
2021-07-08 14:47 ` schwab@linux-m68k.org
2021-07-08 14:49 ` msebor at gcc dot gnu.org
2021-07-08 15:47 ` msebor at gcc dot gnu.org
2021-07-08 17:44 ` cvs-commit at gcc dot gnu.org
2021-07-08 18:04 ` msebor at gcc dot gnu.org
2021-07-08 21:20 ` bergner at gcc dot gnu.org
2021-07-08 22:13 ` msebor at gcc dot gnu.org
2021-07-10  2:49 ` cvs-commit at gcc dot gnu.org
2021-07-13 16:10 ` msebor at gcc dot gnu.org
2021-07-16 16:33 ` abidh at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).