public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
@ 2024-06-17 18:23 dilfridge at gentoo dot org
  2024-06-17 18:24 ` [Bug target/115526] " dilfridge at gentoo dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dilfridge at gentoo dot org @ 2024-06-17 18:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115526
           Summary: regression in 14: invalid assember emitted for alpha,
                    "Error: duplicate !tlsgd!62"
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dilfridge at gentoo dot org
  Target Milestone: ---

Compiling Python 3.12.4 on Gentoo for alpha fails with the following message:

alpha-unknown-linux-gnu-gcc -c -fno-strict-overflow -Wsign-compare -mieee
-DNDEBUG     -mieee -pipe -O2 -mcpu=ev4 -fwrapv -std=c11 -Wextra
-Wno-unused-parameter  
  -Wno-missing-field-initializers -Wstrict-prototypes
-Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal
 -I. -I./Include -I/usr/include/ncursesw   
  -fPIC -DPy_BUILD_CORE  -o Python/dtoa.o Python/dtoa.c
{standard input}: Assembler messages:
{standard input}:1773: Error: duplicate !tlsgd!62
make: *** [Makefile:2748: Python/dtoa.o] Error 1

This worked fine with gcc-13 and is now broken with

dilfridge-alpha / # gcc --version
gcc (Gentoo 14.1.1_p20240615 p2) 14.1.1 20240615
[...]
dilfridge-alpha / # as --version
GNU assembler (Gentoo 2.42 p3) 2.42.0

Preprocessed source and assembler source follow.

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

* [Bug target/115526] regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
  2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
@ 2024-06-17 18:24 ` dilfridge at gentoo dot org
  2024-06-17 18:24 ` dilfridge at gentoo dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dilfridge at gentoo dot org @ 2024-06-17 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andreas K. Huettel <dilfridge at gentoo dot org> ---
Created attachment 58453
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58453&action=edit
preprocessed source file

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

* [Bug target/115526] regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
  2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
  2024-06-17 18:24 ` [Bug target/115526] " dilfridge at gentoo dot org
@ 2024-06-17 18:24 ` dilfridge at gentoo dot org
  2024-06-17 20:50 ` [Bug target/115526] [14/15 regression] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dilfridge at gentoo dot org @ 2024-06-17 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andreas K. Huettel <dilfridge at gentoo dot org> ---
Created attachment 58454
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58454&action=edit
assembler source file

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

* [Bug target/115526] [14/15 regression] invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
  2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
  2024-06-17 18:24 ` [Bug target/115526] " dilfridge at gentoo dot org
  2024-06-17 18:24 ` dilfridge at gentoo dot org
@ 2024-06-17 20:50 ` pinskia at gcc dot gnu.org
  2024-06-17 20:54 ` pinskia at gcc dot gnu.org
  2024-06-20 17:46 ` dilfridge at gentoo dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-17 20:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.2

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

* [Bug target/115526] [14/15 regression] invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
  2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
                   ` (2 preceding siblings ...)
  2024-06-17 20:50 ` [Bug target/115526] [14/15 regression] " pinskia at gcc dot gnu.org
@ 2024-06-17 20:54 ` pinskia at gcc dot gnu.org
  2024-06-20 17:46 ` dilfridge at gentoo dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-17 20:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

        beq $10,$L293
        lda $13,_Py_tss_tstate($29)             !tlsgd!62
...


$L293:
        lda $16,1($31)
        ldq $27,Balloc($29)             !literal!78
        jsr $26,($27),0         !lituse_jsr!78
        ldah $29,0($26)         !gpdisp!79
        lda $29,0($29)          !gpdisp!79
        mov $0,$10
        beq $0,$L260
        lda $1,625($31)
        stl $1,24($0)
        lda $1,1($31)
        stl $1,20($0)
        stq $0,5288($12)
        lda $13,_Py_tss_tstate($29)             !tlsgd!62
        stq $31,0($0)

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

* [Bug target/115526] [14/15 regression] invalid assember emitted for alpha, "Error: duplicate !tlsgd!62"
  2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
                   ` (3 preceding siblings ...)
  2024-06-17 20:54 ` pinskia at gcc dot gnu.org
@ 2024-06-20 17:46 ` dilfridge at gentoo dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dilfridge at gentoo dot org @ 2024-06-20 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andreas K. Huettel <dilfridge at gentoo dot org> ---
Here's what cvise came up with as minimal test case.

1) compile command:
alpha-unknown-linux-gnu-gcc -c -fno-strict-overflow -Wsign-compare -mieee
-DNDEBUG     -mieee -pipe -O2 -mcpu=ev4 -fwrapv -std=c11 \
   -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
-Wstrict-prototypes -Werror=implicit-function-declaration \
   -fvisibility=hidden -fPIC -DPy_BUILD_CORE  -o test $1

2) interestingness test:
/home/huettel/alpha-bug/compile.sh dtoa.i 2>&1 | grep 'Error: duplicate
!tlsgd!'

3) output:
======================
struct _ts {
  struct _dtoa_state *interp
};
struct Bigint {
  int k
} *_Py_dg_strtod_bs;
struct _dtoa_state {
  struct Bigint p5s;
  struct Bigint *freelist[]
};
extern _Thread_local struct _ts _Py_tss_tstate;
typedef struct Bigint Bigint;
int pow5mult_k;
long _Py_dg_strtod_ndigits;
void PyMem_Free();
void Bfree(Bigint *v) {
  if (v)
    if (v->k)
      PyMem_Free();
    else {
      struct _dtoa_state *interp = _Py_tss_tstate.interp;
      interp->freelist[v->k] = v;
    }
}
static Bigint *pow5mult(Bigint *b) {
  for (;;) {
    if (pow5mult_k & 1) {
      Bfree(b);
      if (b == 0)
        return 0;
    }
    if (!(pow5mult_k >>= 1))
      break;
  }
}
void _Py_dg_strtod() {
  if (_Py_dg_strtod_ndigits)
    pow5mult(_Py_dg_strtod_bs);
}
======================

4) double-check:
huettel@crossdev ~/alpha-bug $ ./compile.sh dtoa.i
dtoa.i:3:1: warning: no semicolon at end of struct or union
    3 | };
      | ^
dtoa.i:6:1: warning: no semicolon at end of struct or union
    6 | } *_Py_dg_strtod_bs;
      | ^
dtoa.i:10:1: warning: no semicolon at end of struct or union
   10 | };
      | ^
dtoa.i:15:1: warning: function declaration isn’t a prototype
[-Wstrict-prototypes]
   15 | void PyMem_Free();
      | ^~~~
dtoa.i:36:6: warning: function declaration isn’t a prototype
[-Wstrict-prototypes]
   36 | void _Py_dg_strtod() {
      |      ^~~~~~~~~~~~~
{standard input}: Assembler messages:
{standard input}:140: Error: duplicate !tlsgd!6

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-17 18:23 [Bug target/115526] New: regression in 14: invalid assember emitted for alpha, "Error: duplicate !tlsgd!62" dilfridge at gentoo dot org
2024-06-17 18:24 ` [Bug target/115526] " dilfridge at gentoo dot org
2024-06-17 18:24 ` dilfridge at gentoo dot org
2024-06-17 20:50 ` [Bug target/115526] [14/15 regression] " pinskia at gcc dot gnu.org
2024-06-17 20:54 ` pinskia at gcc dot gnu.org
2024-06-20 17:46 ` dilfridge at gentoo dot 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).