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

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).