[Bug pch/90326] Using any precompiled header breaks definition of FLT_MAX

2019-05-11 Thread asmith at feralinteractive dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90326

Alex Smith  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Alex Smith  ---
Confirmed that fixes it (built and test 9.1.0 from source without/with that
patch applied). Thanks!

[Bug pch/90326] Using any precompiled header breaks definition of FLT_MAX

2019-05-09 Thread asmith at feralinteractive dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90326

--- Comment #3 from Alex Smith  ---
Still reproduces on 9.1.1-1.fc30.

[Bug pch/90326] Using any precompiled header breaks definition of FLT_MAX

2019-05-03 Thread asmith at feralinteractive dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90326

--- Comment #2 from Alex Smith  ---
It still repros for me on 9.0.1-0.16.fc31.

Slightly reduced test case:

$ cat test.h
#define TEST 1
$ cat test.cpp
#include 
static_assert(__FLT_MAX__ > 0);
int main() { return 0; }
$ g++ -o test test.cpp -include test.h
$ g++ -x c++-header -c test.h -o test.h.gch
$ g++ -o test test.cpp -include test.h
test.cpp:2:27: error: static assertion failed
2 | static_assert(__FLT_MAX__ > 0);

Note __FLT_MAX__ is failing as well as FLT_MAX.

However, if I remove "#include ", it compiles successfully.

[Bug pch/90326] New: Using any precompiled header breaks definition of FLT_MAX

2019-05-03 Thread asmith at feralinteractive dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90326

Bug ID: 90326
   Summary: Using any precompiled header breaks definition of
FLT_MAX
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: pch
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asmith at feralinteractive dot com
  Target Milestone: ---

With Fedora 30's GCC 9.0.1 (gcc (GCC) 9.0.1 20190312 (Red Hat 9.0.1-0.10)),
including any precompiled header will result in FLT_MAX being defined to 0,
rather than the correct value.

Reproduction test case:

10:40:54 ~ $ cat test.cpp
#include 
#include 
int main()
{
float f = FLT_MAX;
printf("%f\n", f);
return 0;
}
10:40:56 ~ $ cat test.h
#define TEST 1
10:40:58 ~ $ g++ -o test test.cpp
10:41:08 ~ $ ./test
340282346638528859811704183484516925440.00
10:41:10 ~ $ g++ -o test test.cpp -include test.h
10:41:16 ~ $ ./test
340282346638528859811704183484516925440.00
10:41:17 ~ $ g++ -x c++-header -c test.h -o test.h.gch
10:41:28 ~ $ g++ -o test test.cpp -include test.h
10:41:32 ~ $ ./test
0.00

I'm unsure if any other definitions are affected but FLT_MAX is the one that
was most obviously broken to me as the incorrect value causes us a ton of
issues.

GCC 8.3.0 on Arch Linux is not affected.