[Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp

2014-05-04 Thread megahallon at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60014

--- Comment #1 from Fredrik Hallenberg  ---
Same results with gcc 4.9.0


[Bug c/65875] New: internal compiler error with gcc 5.1

2015-04-24 Thread megahallon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65875

Bug ID: 65875
   Summary: internal compiler error with gcc 5.1
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: megahallon at gmail dot com

Created attachment 35394
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35394&action=edit
Preprocessed C file causing gcc crash

The enclosed file crashes gcc when compiled with -O2 as seen below. -O1 works.
It works with gcc 4.9.0.

$ gcc -v -O2 -c ~/gcc5.1bug.c

Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 5.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-O2' '-c' '-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/cc1 -quiet -v
/home/hallon/gcc5.1bug.c -quiet -dumpbase gcc5.1bug.c -mtune=generic
-march=x86-64 -auxbase gcc5.1bug -O2 -version -o /tmp/cccJihQs.s
GNU C11 (GCC) version 5.1.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 5.1.0, GMP version 6.0.0, MPFR version 3.1.2, MPC
version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/include-fixed
 /usr/include
End of search list.
GNU C11 (GCC) version 5.1.0 (x86_64-unknown-linux-gnu)
compiled by GNU C version 5.1.0, GMP version 6.0.0, MPFR version 3.1.2, MPC
version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2f2bc897849713002cc329f649d8
src/sets/bitset.c: In function ‘mutbitset_iop_PyLongObject’:
src/sets/bitset.c:2021:20: warning: passing argument 1 of ‘_PyLong_Frexp’ from
incompatible pointer type [-Wincompatible-pointer-types]
In file included from
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0,
 from src/sets/bitset.c:3:
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8:
note: expected ‘PyLongObject * {aka struct _longobject *}’ but argument is of
type ‘PyObject * {aka struct _object *}’
src/sets/bitset.c:2021:23: warning: passing argument 2 of ‘_PyLong_Frexp’ from
incompatible pointer type [-Wincompatible-pointer-types]
In file included from
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0,
 from src/sets/bitset.c:3:
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8:
note: expected ‘Py_ssize_t * {aka long int *}’ but argument is of type ‘int *’
src/sets/bitset.c:2034:20: warning: passing argument 1 of ‘_PyLong_Frexp’ from
incompatible pointer type [-Wincompatible-pointer-types]
In file included from
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0,
 from src/sets/bitset.c:3:
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8:
note: expected ‘PyLongObject * {aka struct _longobject *}’ but argument is of
type ‘PyObject * {aka struct _object *}’
src/sets/bitset.c:2034:23: warning: passing argument 2 of ‘_PyLong_Frexp’ from
incompatible pointer type [-Wincompatible-pointer-types]
In file included from
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/Python.h:88:0,
 from src/sets/bitset.c:3:
/srv/sdb1/jenkins/workspaces/develop-5.x/tmp/deploy/include/python2.7/longobject.h:43:8:
note: expected ‘Py_ssize_t * {aka long int *}’ but argument is of type ‘int *’
src/sets/bitset.c: In function ‘sf_slice’:
src/sets/bitset.c:2985:1: internal compiler error: Segmentation fault
0x9bab0f crash_signal
../.././gcc/toplev.c:383
0xb73110 compare_values_warnv
../.././gcc/tree-vrp.c:1337
0xb7371c compare_values
../.././gcc/tree-vrp.c:1533
0xb833bc vrp_visit_phi_node
../.././gcc/tree-vrp.c:8879
0xad932d simulate_stmt
../.././gcc/tree-ssa-propagate.c:344
0xad9467 process_ssa_edge_worklist
../.././gcc/tree-ssa-propagate.c:422
0xada1fd ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**,
tree_node**), ssa_prop_result (*)(gphi*))
../.././gcc/tree-ssa-propagate.c:896
0xb7b394 execute_vrp
../.././gcc/tree-vrp.c:10367
0xb7b394 execute
../.././gcc/tree-vrp.c:10447

[Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp

2015-04-28 Thread megahallon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60014

--- Comment #5 from Fredrik Hallenberg  ---
Same results with gcc 5.1.0.


[Bug c/60014] New: Bad warning suppression

2014-01-31 Thread megahallon at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60014

Bug ID: 60014
   Summary: Bad warning suppression
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: megahallon at gmail dot com

Using gcc 4.8.2:

/tmp/foo/foo.h:
---
#define FOO(a, b) __LINE__;
---

bug.c:
---
#include "foo.h"

int main()
{
  FOO(1, 
  0);
  char* a = 1;
}
---

$ /usr/bin/gcc bug.c -isystem /tmp/foo -no-integrated-cpp

should give a warning on line 7 but it not seen.

These works:

$ /usr/bin/gcc bug.c -isystem /tmp/foo -no-integrated-cpp
-ftrack-macro-expansion=0
$ /usr/bin/gcc bug.c -I /tmp/foo -no-integrated-cpp
$ /usr/bin/gcc bug.c -isystem /tmp/foo

-save-temps gives the same results as -no-integrated-cpp.

Output from -save-temps:

bug.i
-
void main()
{

 6
# 5 "bug.c" 3 4
  ;
;
  char *a = 1;
}
-

The suppress flag in the line directive apparently affects line 7 which is not
as expected.

In practice this means that ccache and similar systems that compiles
preprocessed output may fail to show warnings that are seen when compiling
normally.


[Bug c++/66517] New: [5 Regression] [C++11] sorry, unimplemented: unexpected AST of kind type_decl

2015-06-11 Thread megahallon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66517

Bug ID: 66517
   Summary: [5 Regression] [C++11] sorry, unimplemented:
unexpected AST of kind type_decl
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: megahallon at gmail dot com
  Target Milestone: ---

The following snippet:

-
template 
void p()
{
  int val = ({union {int x;}; 3;}
  );
}
-

built with g++ 5.1.0:

g++ -std=c++11 bug.cpp -c

gives the following error:

bug.cpp: In function ‘void p()’:
bug.cpp:5:3: sorry, unimplemented: unexpected AST of kind type_decl
   );
   ^

Same error with -std=c++14 but works with -std=c++98.
Also works with g++ 4.8.2.

Output from g++ -v:

Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 5.1.0 (GCC)

[Bug preprocessor/60014] Bad warning suppression caused by track-macro-expansion when not using integrated cpp

2016-06-23 Thread megahallon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60014

--- Comment #6 from Fredrik Hallenberg  ---
Reconfirmed with gcc 6.1.1

[Bug preprocessor/71637] New: -Wmisleading-indentation only triggered when using integrated cpp

2016-06-23 Thread megahallon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71637

Bug ID: 71637
   Summary: -Wmisleading-indentation only triggered when using
integrated cpp
   Product: gcc
   Version: 6.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: megahallon at gmail dot com
  Target Milestone: ---

The following program:

---
#define m(x) ({ int y; if (x) y=0; else y=1; y; })

int main()
{
  int x =
m(0);
  return x;
}

---

compiled with:

gcc -ftrack-macro-expansion=0 -Wmisleading-indentation test.c

Gives a warning:

test.c:6:5: warning: this ‘else’ clause does not guard...
[-Wmisleading-indentation]
 m(0);
 ^

Which is possibly as expected given no macro expansion tracking, however when
trying to check the output with -save-temps (or using -no-integrated-cpp) the
warning is not issued making it difficult to understand what is going on.

This is extra confusing when using ccache (or similar system working on
preprocessed files) and -Werror as a ccache build will work, while not using
ccache will fail. By the way, ccache is also the reason to use
-ftrack-macro-expansion=0, see bug 60014.

gcc version 6.1.1 20160620 (Debian 6.1.1-7)