public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103377] New: [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b
@ 2021-11-23  8:43 marxin at gcc dot gnu.org
  2021-11-23  8:45 ` [Bug tree-optimization/103377] " pinskia at gcc dot gnu.org
  2021-11-23  8:47 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-23  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103377
           Summary: [12 Regression] False positive -Werror=array-bounds in
                    gdb since
                    r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51856
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51856&action=edit
test-case

It's a false positive:

$ g++ language.i -O2 -Werror=array-bounds -c
In file included from /usr/include/c++/11/functional:65,
                 from ../../gdb/../gdbsupport/ptid.h:35,
                 from ../../gdb/../gdbsupport/common-defs.h:198,
                 from ../../gdb/defs.h:28,
                 from ../../gdb/language.c:31:
In function ‘void std::__final_insertion_sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator = const char**;
_Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const char*, const
char*)>]’,
    inlined from ‘void std::__sort(_RandomAccessIterator,
_RandomAccessIterator, _Compare) [with _RandomAccessIterator = const char**;
_Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const char*, const
char*)>]’ at /usr/include/c++/11/bits/stl_algo.h:1957:31,
    inlined from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter =
const char**; _Compare = bool (*)(const char*, const char*)]’ at
/usr/include/c++/11/bits/stl_algo.h:4875:18,
    inlined from ‘void add_set_language_command()’ at
../../gdb/language.c:492:13,
    inlined from ‘void _initialize_language()’ at ../../gdb/language.c:1175:28:
/usr/include/c++/11/bits/stl_algo.h:1866:32: error: array subscript 19 is
outside array bounds of ‘void [136]’ [-Werror=array-bounds]
 1866 |           std::__insertion_sort(__first, __first + int(_S_threshold),
__comp);
      |          
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘void add_set_language_command()’,
    inlined from ‘void _initialize_language()’ at ../../gdb/language.c:1175:28:
../../gdb/language.c:474:117: note: at offset 152 into object of size 136
allocated by ‘operator new []’
  474 |   language_names = new const char *[ARRAY_SIZE
(language_defn::languages) + 2];
      |                                                                        
                                            ^
cc1plus: some warnings being treated as errors

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

* [Bug tree-optimization/103377] [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b
  2021-11-23  8:43 [Bug tree-optimization/103377] New: [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b marxin at gcc dot gnu.org
@ 2021-11-23  8:45 ` pinskia at gcc dot gnu.org
  2021-11-23  8:47 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-23  8:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I just posted a new patch to fix this one.  Anyways it is a dup of bug 102216.

*** This bug has been marked as a duplicate of bug 102216 ***

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

* [Bug tree-optimization/103377] [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b
  2021-11-23  8:43 [Bug tree-optimization/103377] New: [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b marxin at gcc dot gnu.org
  2021-11-23  8:45 ` [Bug tree-optimization/103377] " pinskia at gcc dot gnu.org
@ 2021-11-23  8:47 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-23  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Cool, thanks!

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

end of thread, other threads:[~2021-11-23  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23  8:43 [Bug tree-optimization/103377] New: [12 Regression] False positive -Werror=array-bounds in gdb since r12-2132-ga110855667782dac7b674d3e328b253b3b3c919b marxin at gcc dot gnu.org
2021-11-23  8:45 ` [Bug tree-optimization/103377] " pinskia at gcc dot gnu.org
2021-11-23  8:47 ` marxin 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).