public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind
@ 2023-12-11  8:55 jakub at gcc dot gnu.org
  2023-12-11  8:55 ` [Bug middle-end/112953] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-11  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112953
           Summary: [14 Regressions] -Wno-attributes* failures under
                    valgrind
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

In --enable-checking=release,valgrind build I'm seeing
FAIL: c-c++-common/Wno-attributes-2.c  -Wc++-compat  (test for excess errors)
Excess errors:
==974681== Mismatched free() / delete / delete []
==974681==    at 0x484965B: operator delete[](void*) (vg_replace_malloc.c:1103)
==974681==    by 0x707434: free_attr_data() (attribs.cc:318)
==974681==    by 0xCFF8A4: compile_file() (toplev.cc:454)
==974681==    by 0x704D23: do_compile (toplev.cc:2150)
==974681==    by 0x704D23: toplev::main(int, char**) (toplev.cc:2306)
==974681==    by 0x7064BA: main (main.cc:39)
==974681==  Address 0x51dffa0 is 0 bytes inside a block of size 40 alloc'd
==974681==    at 0x4845FF5: operator new(unsigned long)
(vg_replace_malloc.c:422)
==974681==    by 0x70A040: handle_ignored_attributes_option(vec<char*, va_heap,
vl_ptr>*) (attribs.cc:301)
==974681==    by 0x7FA089: handle_pragma_diagnostic_impl<false, false>
(c-pragma.cc:934)
==974681==    by 0x7FA089: handle_pragma_diagnostic(cpp_reader*)
(c-pragma.cc:1028)
==974681==    by 0x75814F: c_parser_pragma(c_parser*, pragma_context, bool*)
(c-parser.cc:14707)
==974681==    by 0x784A85: c_parser_external_declaration(c_parser*)
(c-parser.cc:2027)
==974681==    by 0x785223: c_parser_translation_unit (c-parser.cc:1900)
==974681==    by 0x785223: c_parse_file() (c-parser.cc:26713)
==974681==    by 0x7F6331: c_common_parse_file() (c-opts.cc:1301)
==974681==    by 0xCFF87D: compile_file() (toplev.cc:446)
==974681==    by 0x704D23: do_compile (toplev.cc:2150)
==974681==    by 0x704D23: toplev::main(int, char**) (toplev.cc:2306)
==974681==    by 0x7064BA: main (main.cc:39)
(and also in -4.c, -5.c, -6.c).
This was introduced in r14-6076-g7fa24687aa3a683fd105ce5ff6b176f48dca3b6c I
believe.

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

* [Bug middle-end/112953] [14 Regressions] -Wno-attributes* failures under valgrind
  2023-12-11  8:55 [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind jakub at gcc dot gnu.org
@ 2023-12-11  8:55 ` jakub at gcc dot gnu.org
  2023-12-11  8:56 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-11  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Target Milestone|---                         |14.0
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-12-11
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

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

* [Bug middle-end/112953] [14 Regressions] -Wno-attributes* failures under valgrind
  2023-12-11  8:55 [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind jakub at gcc dot gnu.org
  2023-12-11  8:55 ` [Bug middle-end/112953] " jakub at gcc dot gnu.org
@ 2023-12-11  8:56 ` jakub at gcc dot gnu.org
  2023-12-13 10:36 ` cvs-commit at gcc dot gnu.org
  2023-12-13 11:10 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-11  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
2023-12-11  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/112953
        * attribs.cc (free_attr_data): Use delete x rather than delete[] x.

--- gcc/attribs.cc.jj   2023-12-09 10:19:57.809813529 +0100
+++ gcc/attribs.cc      2023-12-11 09:55:28.894461698 +0100
@@ -315,7 +315,7 @@ void
 free_attr_data ()
 {
   for (auto x : ignored_attributes_table)
-    delete[] x;
+    delete x;
   ignored_attributes_table.release ();
 }


should fix this.

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

* [Bug middle-end/112953] [14 Regressions] -Wno-attributes* failures under valgrind
  2023-12-11  8:55 [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind jakub at gcc dot gnu.org
  2023-12-11  8:55 ` [Bug middle-end/112953] " jakub at gcc dot gnu.org
  2023-12-11  8:56 ` jakub at gcc dot gnu.org
@ 2023-12-13 10:36 ` cvs-commit at gcc dot gnu.org
  2023-12-13 11:10 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-13 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:bb600f9822fb8b73d75df2b3fa7a0fab391254fa

commit r14-6486-gbb600f9822fb8b73d75df2b3fa7a0fab391254fa
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Dec 13 11:35:20 2023 +0100

    attribs: Fix valgrind failures on -Wno-attributes* tests [PR112953]

    The r14-6076 change changed the allocation of attribute tables from
    table = new attribute_spec[2];
    to
    table = new attribute_spec { ... };
    with
    ignored_attributes_table.safe_push (table);
    later in both cases, but didn't change the corresponding delete in
    free_attr_data, which means valgrind is unhappy about that:
    FAIL: c-c++-common/Wno-attributes-2.c  -Wc++-compat  (test for excess
errors)
    Excess errors:
    ==974681== Mismatched free() / delete / delete []
    ==974681==    at 0x484965B: operator delete[](void*)
(vg_replace_malloc.c:1103)
    ==974681==    by 0x707434: free_attr_data() (attribs.cc:318)
    ==974681==    by 0xCFF8A4: compile_file() (toplev.cc:454)
    ==974681==    by 0x704D23: do_compile (toplev.cc:2150)
    ==974681==    by 0x704D23: toplev::main(int, char**) (toplev.cc:2306)
    ==974681==    by 0x7064BA: main (main.cc:39)
    ==974681==  Address 0x51dffa0 is 0 bytes inside a block of size 40 alloc'd
    ==974681==    at 0x4845FF5: operator new(unsigned long)
(vg_replace_malloc.c:422)
    ==974681==    by 0x70A040: handle_ignored_attributes_option(vec<char*,
va_heap, vl_ptr>*) (attribs.cc:301)
    ==974681==    by 0x7FA089: handle_pragma_diagnostic_impl<false, false>
(c-pragma.cc:934)
    ==974681==    by 0x7FA089: handle_pragma_diagnostic(cpp_reader*)
(c-pragma.cc:1028)
    ==974681==    by 0x75814F: c_parser_pragma(c_parser*, pragma_context,
bool*) (c-parser.cc:14707)
    ==974681==    by 0x784A85: c_parser_external_declaration(c_parser*)
(c-parser.cc:2027)
    ==974681==    by 0x785223: c_parser_translation_unit (c-parser.cc:1900)
    ==974681==    by 0x785223: c_parse_file() (c-parser.cc:26713)
    ==974681==    by 0x7F6331: c_common_parse_file() (c-opts.cc:1301)
    ==974681==    by 0xCFF87D: compile_file() (toplev.cc:446)
    ==974681==    by 0x704D23: toplev::main(int, char**) (toplev.cc:2306)
    ==974681==    by 0x7064BA: main (main.cc:39)

    2023-12-13  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/112953
            * attribs.cc (free_attr_data): Use delete x rather than delete[] x.

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

* [Bug middle-end/112953] [14 Regressions] -Wno-attributes* failures under valgrind
  2023-12-11  8:55 [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-12-13 10:36 ` cvs-commit at gcc dot gnu.org
@ 2023-12-13 11:10 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-13 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-12-13 11:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11  8:55 [Bug middle-end/112953] New: [14 Regressions] -Wno-attributes* failures under valgrind jakub at gcc dot gnu.org
2023-12-11  8:55 ` [Bug middle-end/112953] " jakub at gcc dot gnu.org
2023-12-11  8:56 ` jakub at gcc dot gnu.org
2023-12-13 10:36 ` cvs-commit at gcc dot gnu.org
2023-12-13 11:10 ` jakub 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).