public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
@ 2022-05-08 18:18 mikpelinux at gmail dot com
  2022-05-08 19:17 ` [Bug target/105525] " schwab@linux-m68k.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2022-05-08 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105525
           Summary: some targets don't define __INTPTR_TYPE__ breaking
                    libgcov-driver.c
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Attempting to build a gcc-12.1.0 based cross-compiler to lm32-uclinux-uclibc or
vax-unknown-linux fails with

/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c: In function
'write_topn_counters':
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:457:56: error:
'__INTPTR_TYPE__' undeclared (first use in this function); did you mean
'INTPTR_TYPE'?
  457 |       for (struct gcov_kvp *node = (struct gcov_kvp
*)(__INTPTR_TYPE__)start;
      |                                                        ^~~~~~~~~~~~~~~
      |                                                        INTPTR_TYPE
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:457:56: note:
each undeclared identifier is reported only once for each function it appears
in
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:457:72: error:
expected ',' or ';' before 'start'
  457 |       for (struct gcov_kvp *node = (struct gcov_kvp
*)(__INTPTR_TYPE__)start;
      |                                                                       
^~~~~
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:454:17: warning:
unused variable 'start' [-Wunused-variable]
  454 |       gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2];
      |                 ^~~~~
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:476:72: error:
expected ',' or ';' before 'start'
  476 |       for (struct gcov_kvp *node = (struct gcov_kvp
*)(__INTPTR_TYPE__)start;
      |                                                                       
^~~~~
/mnt/scratch/cross/sources/gcc-12.1.0/libgcc/libgcov-driver.c:473:17: warning:
unused variable 'start' [-Wunused-variable]
  473 |       gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2];
      |                 ^~~~~
make[2]: *** [Makefile:928: _gcov_info_to_gcda.o] Error 1
make[2]: Leaving directory
'/mnt/scratch/cross/objdir-vax-gcc/vax-unknown-linux/libgcc'
make[1]: *** [Makefile:12928: all-target-libgcc] Error 2
make[1]: Leaving directory '/mnt/scratch/cross/objdir-vax-gcc'
make: *** [Makefile:1012: all] Error 2

These builds work with gcc-11.3.0, so it's a regression. I haven't bisected but
I believe this started with:

2021-08-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>

        * libgcov-driver.c (#include <stdint.h>): Remove.
        (write_topn_counters): Use __INTPTR_TYPE__ instead of intptr_t.

However, a deeper question is _why_ don't these two targets define
__INTPTR_TYPE__ when so many others do? I suspect that's the real bug here.

Workarounds: revert to gcc-11.3.0, or build gcc-12.1.0 with --disable-gcov.

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
@ 2022-05-08 19:17 ` schwab@linux-m68k.org
  2023-04-28 16:48 ` mikpelinux at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2022-05-08 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
Those two targets are lacking an appropriate inclusion of one of the *-stdint.h
files in their tm_file list in gcc/config.gcc.

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
  2022-05-08 19:17 ` [Bug target/105525] " schwab@linux-m68k.org
@ 2023-04-28 16:48 ` mikpelinux at gmail dot com
  2023-04-28 17:47 ` mikpelinux at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2023-04-28 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
The issue issue remains in gcc-13.1.0 but is no longer limited to gcov, i.e. a
vax build with --disable-gcov using gcc-13.1.0 now fails with

In file included from
/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/unwind-dw2-fde-dip.c:579:
/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/unwind-dw2-fde.c:45:9: error:
unknown type name '__UINTPTR_TYPE__'
   45 | typedef __UINTPTR_TYPE__ uintptr_type;
      |         ^~~~~~~~~~~~~~~~
/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/unwind-dw2-fde.c: In function
'classify_object_over_fdes':
/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/unwind-dw2-fde.c:777:28: warning:
comparison of integer expressions of different signedness: '_Unwind_Ptr' {aka
'unsigned int'} and 'uintptr_type' {aka 'int'} [-Wsign-compare]
  777 |               if (pc_begin < range[0])
      |                            ^
/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/unwind-dw2-fde.c:779:26: warning:
comparison of integer expressions of different signedness: '_Unwind_Ptr' {aka
'unsigned int'} and 'uintptr_type' {aka 'int'} [-Wsign-compare]
  779 |               if (pc_end > range[1])
      |                          ^
make[2]: *** [/mnt/scratch/cross/sources/gcc-13.1.0/libgcc/static-object.mk:17:
unwind-dw2-fde-dip.o] Error 1
make[2]: Leaving directory '/tmp/objdir-gcc-vax/vax-unknown-linux/libgcc'
make[1]: *** [Makefile:12865: all-target-libgcc] Error 2
make[1]: Leaving directory '/tmp/objdir-gcc-vax'
make: *** [Makefile:1020: all] Error 2

lm32 is similar.

I will submit a patch shortly.

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
  2022-05-08 19:17 ` [Bug target/105525] " schwab@linux-m68k.org
  2023-04-28 16:48 ` mikpelinux at gmail dot com
@ 2023-04-28 17:47 ` mikpelinux at gmail dot com
  2023-04-29 16:58 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2023-04-28 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-April/617071.html

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
                   ` (2 preceding siblings ...)
  2023-04-28 17:47 ` mikpelinux at gmail dot com
@ 2023-04-29 16:58 ` cvs-commit at gcc dot gnu.org
  2024-01-06  9:32 ` mikpelinux at gmail dot com
  2024-01-20 17:19 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-29 16:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:

https://gcc.gnu.org/g:83c78cb0d78fffa8791f64ba36146d17c00c1b23

commit r14-348-g83c78cb0d78fffa8791f64ba36146d17c00c1b23
Author: Mikael Pettersson <mikpelinux@gmail.com>
Date:   Sat Apr 29 10:56:54 2023 -0600

    add glibc-stdint.h to vax and lm32 linux target (PR target/105525)

    PR target/105525 is a build regression for the vax and lm32 linux
    targets present in gcc-12/13/head, where the builds fail due to
    unsatisfied references to __INTPTR_TYPE__ and __UINTPTR_TYPE__,
    caused by these two targets failing to provide glibc-stdint.h.

    Fixed thusly, tested by building crosses, which now succeeds.

    Ok for trunk? (Note I don't have commit rights.)

            PR target/105525
    gcc/
            * config.gcc (vax-*-linux*): Add glibc-stdint.h.
            (lm32-*-uclinux*): Likewise.

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
                   ` (3 preceding siblings ...)
  2023-04-29 16:58 ` cvs-commit at gcc dot gnu.org
@ 2024-01-06  9:32 ` mikpelinux at gmail dot com
  2024-01-20 17:19 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-06  9:32 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |14.0

--- Comment #5 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Fixed for gcc-14, no plans to backport.

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

* [Bug target/105525] some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c
  2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
                   ` (4 preceding siblings ...)
  2024-01-06  9:32 ` mikpelinux at gmail dot com
@ 2024-01-20 17:19 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-20 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 18:18 [Bug target/105525] New: some targets don't define __INTPTR_TYPE__ breaking libgcov-driver.c mikpelinux at gmail dot com
2022-05-08 19:17 ` [Bug target/105525] " schwab@linux-m68k.org
2023-04-28 16:48 ` mikpelinux at gmail dot com
2023-04-28 17:47 ` mikpelinux at gmail dot com
2023-04-29 16:58 ` cvs-commit at gcc dot gnu.org
2024-01-06  9:32 ` mikpelinux at gmail dot com
2024-01-20 17:19 ` 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).