public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error
@ 2024-06-18 23:06 nikhilg1 at uci dot edu
  2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nikhilg1 at uci dot edu @ 2024-06-18 23:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115546
           Summary: [14.1.0 Regression] Section Type Conflict Error
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nikhilg1 at uci dot edu
  Target Milestone: ---

Consider the following reduced test case:

$>cat test.cpp
template <class T>
int v2 __attribute__((section("A"))) = sizeof(T);

template <>
int v2<double> __attribute__((section("A"))) = 50;

void a(int*& x) {
  x = &v2<int>;
}

$>g++-13 -c test.cpp && echo OK
OK

$>g++-14 -c test.cpp && echo OK
test.cpp:2:5: error: 'v2<int>' causes a section type conflict with 'v2<double>'
    2 | int v2 __attribute__((section("A"))) = sizeof(T);
      |     ^~
test.cpp:5:5: note: 'v2<double>' was declared here
    5 | int v2<double> __attribute__((section("A"))) = 50;
      |     ^~~~~~~~~~

$>clang++-17 -c test.cpp && echo OK
OK


I am looking through the docs on the section attribute
(https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Common-Variable-Attributes.html)
but am not able to see any reason why this case has started to fail. I also
don't see any other compiler failing for this case.

Issue is occurring since g++ 14.1.0 and seems to be reproducible on trunk as
well.

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

* [Bug c++/115546] [14.1.0 Regression] Section Type Conflict Error
  2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
@ 2024-06-18 23:11 ` pinskia at gcc dot gnu.org
  2024-06-18 23:13 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-18 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
the section attribute was ignored before GCC 14.

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

* [Bug c++/115546] [14.1.0 Regression] Section Type Conflict Error
  2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
  2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
@ 2024-06-18 23:13 ` pinskia at gcc dot gnu.org
  2024-06-18 23:15 ` pinskia at gcc dot gnu.org
  2024-06-18 23:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-18 23:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
But starting with GCC 14, they are not ignored.
In this case you have one variable that is in a comdat section named "A" and
another one which is in a regular section named "A" which conflict.

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

* [Bug c++/115546] [14.1.0 Regression] Section Type Conflict Error
  2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
  2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
  2024-06-18 23:13 ` pinskia at gcc dot gnu.org
@ 2024-06-18 23:15 ` pinskia at gcc dot gnu.org
  2024-06-18 23:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-18 23:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=87178

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The reason why this is invalid is for the same reason why PR 87178 is invalid.

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

* [Bug c++/115546] [14.1.0 Regression] Section Type Conflict Error
  2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
                   ` (2 preceding siblings ...)
  2024-06-18 23:15 ` pinskia at gcc dot gnu.org
@ 2024-06-18 23:17 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-18 23:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
See PR 87178 on why this is invalid.

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

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

end of thread, other threads:[~2024-06-18 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18 23:06 [Bug c++/115546] New: [14.1.0 Regression] Section Type Conflict Error nikhilg1 at uci dot edu
2024-06-18 23:11 ` [Bug c++/115546] " pinskia at gcc dot gnu.org
2024-06-18 23:13 ` pinskia at gcc dot gnu.org
2024-06-18 23:15 ` pinskia at gcc dot gnu.org
2024-06-18 23:17 ` pinskia 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).