public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/96935] New: ICE in subspan, at input.h:69
@ 2020-09-04 11:21 jan.smets at nokia dot com
  2020-09-04 11:37 ` [Bug preprocessor/96935] " jan.smets at nokia dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jan.smets at nokia dot com @ 2020-09-04 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96935
           Summary: ICE in subspan, at input.h:69
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jan.smets at nokia dot com
  Target Milestone: ---

Following ICE is seen :

x.cpp: In function 'void a()':
x.cpp:3: internal compiler error: in subspan, at input.h:69
    3 | #define DB_PRINTF(str, fmt, args...) db_printf(indent_len, 50, fmt,
str, ##args)
      |
x.cpp:7: note: in expansion of macro 'DB_PRINTF'
    7 |   DB_PRINTF("", "%llu", 0);
      |


Target: x86_64-linux-gnu
Configured with: /usr/src/gcc/configure --build=x86_64-linux-gnu
--disable-multilib --enable-languages=c,c++,fortran,go

Compiled with:  -O2 -Wformat 

Reproduces with 
 10.2, 10.1
 9.3, 9.1
Works with
 8.4
 7.5


The reduced testcase is :

#include "x.h"
#define DB_PRINTF(str, fmt, args...) db_printf(indent_len, 50, fmt, str,
##args)
extern "C" void db_printf(unsigned indent_len, unsigned column_split, const
char * fmt, const char * str, ...) __attribute__ ((format (printf, 3, 5)));
void a() {
  unsigned int indent_len = 0;
  DB_PRINTF("", "%llu", 0);
  // preprocesses to: db_printf(indent_len, 50, "%llu", "");
}

But I suspect the testcase is just garbage.

I tried various ways trying to reduce x.h, but even the slightest change makes
the problem go away. "x.h" recursively includes about 200 other header files.
A "flat" x.h (700k lines) (-fdirectives-only) does not reproduce the issue.

This ICE occurs on couple of dozen files in my project. Some print
 "during GIMPLE pass: strlen".

Goes away with --enable-checking=no, but then other problems show up (ICE in
linemap_compare_locations, at libcpp/line-map.c:1359 - which may or may not be
related)

I suppose my next best option is start a bisect between 8.x and 9.x ?

Thanks

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

end of thread, other threads:[~2022-01-11 19:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04 11:21 [Bug preprocessor/96935] New: ICE in subspan, at input.h:69 jan.smets at nokia dot com
2020-09-04 11:37 ` [Bug preprocessor/96935] " jan.smets at nokia dot com
2020-09-04 12:04 ` rguenth at gcc dot gnu.org
2020-09-04 13:00 ` jan.smets at nokia dot com
2020-09-16  2:48 ` [Bug preprocessor/96935] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-09-16  2:49 ` mpolacek at gcc dot gnu.org
2020-09-16  2:58 ` mpolacek at gcc dot gnu.org
2020-09-16 19:30 ` cvs-commit at gcc dot gnu.org
2020-09-16 19:31 ` [Bug preprocessor/96935] [9/10 " mpolacek at gcc dot gnu.org
2020-09-17 14:15 ` cvs-commit at gcc dot gnu.org
2020-09-17 14:16 ` [Bug preprocessor/96935] [9 " mpolacek at gcc dot gnu.org
2020-09-17 16:16 ` jan.smets at nokia dot com
2022-01-11 19:35 ` 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).