[Bug tree-optimization/115582] [15 regression] wrong code when accessing members of incompatible type structure

2024-06-21 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115582 --- Comment #4 from tangyixuan --- Thanks for your concerns. The type of "a.x" is converted to char in "(char *)a + 1", and it may be confused in clang under -O0 vs -O{2,3}. gcc-15 outputs the "int" value, but the previous versions like gcc-5.3

[Bug tree-optimization/115582] New: [regression 15] wrong code when accessing members of incompatible type structure

2024-06-21 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, I find GCC produces wrong code under optimizations when pointers point to incompatible type

[Bug tree-optimization/115492] New: [15 Regression] wrong code at -O2/O3 when compiled with -fPIC

2024-06-14 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, I find that GCC-15 produces the possible wrong code when compiling the following code with "-O3 -fPIC"

[Bug c/115320] New: wrong code with -O2/O3 when using union with different data type

2024-06-02 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, GCC outputs different results with -O1/O3 during the compilation of the following test case. Since Union allows different data

[Bug c++/98042] New: error diagnostic for unmatched parentheses could be improved

2020-11-28 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is invalid due to the missing of ')' after '*' in Line 4. GCC reports an error which is dif

[Bug c++/98031] missing the error message of undeclared label

2020-11-28 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98031 --- Comment #2 from tangyixuan --- (In reply to Jakub Jelinek from comment #1) > This is again diagnostics on uninstantiated template, invalid, no > diagnostics required. > Instantiate the template and it will be diagnosed. Yeah, I agree with yo

[Bug c++/98031] New: missing the error message of undeclared label

2020-11-27 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code has two errors. However, gcc only reports the second error while ignoring the first one. $ cat s.cpp template int fun(T i) { static void* labs

[Bug c++/98030] New: error message for enum definition without ';' could be improved

2020-11-27 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code misses a ';' at the end of the enum definition. GCC reports an error with 'new

[Bug c++/97468] New: gcc crashes when using __may_alias__ attribute

2020-10-17 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code uses '__attribute__ ((__may_alias__))' to alias a struct 'S' to 'a'. However, gcc crashes at compilation time whi

[Bug c++/97446] New: gcc accepts an unnamed struct

2020-10-15 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code has an error in 'S3' (maybe should be 'S2'). gcc accepts it without error diagnostics. $ cat s.cpp template < class T > str

[Bug c++/97443] New: gcc rejects an abstract class that could be used as a function return type due to the new rules

2020-10-15 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the abstract class could be used as a function return type, as well as the parameter type and

[Bug c++/97422] New: gcc rejects 'std::initializer_list' when instantiating with a list

2020-10-14 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, when instantiating a function with a list of integer type, gcc rejects it and reports two duplicate error messa

[Bug c++/97420] New: error: no matching function for call to 'find_if'

2020-10-14 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code maybe valid, since 'std::find_if' is allowed since c++17. https://en.cppreference.com/w/cpp/algorithm/find $ cat s.cpp

[Bug c++/97418] New: error diagnostics do not point the use of undeclared identifier

2020-10-14 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is ill-formed. GCC may not point out the error in code (use of undeclared identifier 'A' and 

[Bug c++/97401] New: static int has a default value?

2020-10-13 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code declares a static Integer without specific value. Usually, it will has a default value '0', and thus 'b[a]' could be declared as b[0] p

[Bug c++/97279] New: GCC ignores the operation definition of the template

2020-10-03 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, gcc selects the overloaded definition operation+() although it is not declared before. $ cat s.cpp #include struct S { template void operator+(T

[Bug c++/97278] New: increment or decrement operator on the same object

2020-10-02 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the parameters of 'func' are based on the values of 'i'. if 'a' is 4, does it mean that 'i' is increased after '

[Bug c++/97256] New: auto function return different result

2020-09-30 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, when executing the following code, GCC reports 32765 while clang reports 1. Maybe there is something wrong? $ cat s.cpp #include auto func(const int a) { const int b

[Bug c++/97202] New: GCC reports an error: expected unqualified-id before ‘short’

2020-09-25 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, GCC 11 rejects the following code when the class 'A' is instantiated. When I fed it into GCC 1O, it is accepted. A

[Bug c++/97200] New: error: use of local variable with automatic storage from containing function

2020-09-25 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code seems valid. The structure 'S' contains a template function 'func1'

[Bug c++/97191] New: ICE In expand_expr_real_1, at expr.c:10234

2020-09-24 Thread tangyixuan at mail dot dlut.edu.cn via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code crashes GCC. $ cat s.cpp struct A { A (); A ( const A &); A ( int ); }; A :: A (){ int a =0; A b [a][0]; } $ g++ -c s.cpp du

[Bug c++/97033] New: g++ hangs on valid code

2020-09-12 Thread tangyixuan at mail dot dlut.edu.cn
: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, g++ hangs when executing the following code with -Os, while clang++ is ok. $ cat s.cpp namespace A { inline int F1 (){} } int F2 ( int (* p )()){ return p (); } int main

[Bug c++/96982] New: no assembler error with -O1/O2/O3, but with -O0

2020-09-08 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is compiled with optimizations (-O1/O2/O3), but is not compiled with -O0. $ cat s.cpp class C1 { static void f1 (); }; class C2

[Bug c++/96981] New: Assembler messages: Error: missing name

2020-09-08 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, g++ cannot compile the following code while clang success. $ cat s.cpp extern char a; char a __attribute__ (( __section__ (""))); $ clang++ -c s.cpp success.

[Bug c++/96980] New: unimplemented of variably-modified type

2020-09-08 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is not compiled by g++ but is compiled by clang. $ cat s.cpp int main (){ int a=2, b=3; int A[a][b]; auto B

[Bug c++/96977] New: mangling ‘typeof’ or use ‘decltype’

2020-09-08 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, GCC can not compile the following code, while Clang can. When I try to replaces "typeof" with "decltype", other errors happens. $ cat s.cpp int F (

[Bug c++/96975] New: gcc cannot compile at -O0 but compiles at -O1/-O2/-O3

2020-09-08 Thread tangyixuan at mail dot dlut.edu.cn
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code is not compiled with -O0, but is compiled with -O1/O2/O3. $ cat s.cpp typedef void (* A )(); template < A T > struct S { S (){}};

[Bug c++/96954] New: gcc times out with -O2/-O3/-Os

2020-09-07 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, gcc times out during execution of ./a.out with -O2/-O3/-Os: $ cat s.cpp template < class A > int B ( const A &){ int a = B ( a ); return a ; } int main

[Bug c++/96944] New: call of overloaded is ambiguous

2020-09-05 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- The following code is rejected by g++. clang++ compiles it successfully. $ cat s.cpp template < int I > int F( char [I]); template < int I > int F( char a = I ); in

[Bug c++/96943] New: incomplete type used in nested name specifier

2020-09-05 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- The following code (maybe valid) is rejected by g++, while is accepted by clang. $ cat s.cpp template < int I > struct CA1{ enum { EA = 0}; }; template &

[Bug c++/96656] New: Segmentation fault with make_friend_class

2020-08-17 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Please consider the following code. Clang++ compiles it successfully, while g++ fails: $: cat s.cpp struct a{}; template struct b { using c=a; }; class B

[Bug c++/96652] New: Segmentation fault with instantiate_class_template_1

2020-08-17 Thread tangyixuan at mail dot dlut.edu.cn
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- g++ crashes on the following code, while clang++ compiles successfully: $: cat s.cpp struct A {}; template struct B { A a; friend decltype(a); }; int

[Bug c++/94210] New: ICE in tsubst, at cp/pt.c:15105

2020-03-18 Thread tangyixuan at mail dot dlut.edu.cn
++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, gcc crashes given the following example, while clang compiles normally. $ cat 1.cpp template struct X {}; namespace Nested { template int f1(X... a); int a1 = f1(X(), X

[Bug c/91839] missing error diagnosis for undeclared identifier

2019-12-03 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91839 --- Comment #3 from tangyixuan --- (In reply to Jonathan Wakely from comment #2) > I can confirm GCC doesn't suggest l_24, but I'm not sure it's reasonable to > expect it to do so after so many parse errors. > > If you fix the first two errors t

[Bug c/92392] -Wignored-qualifiers points to diff location

2019-11-27 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92392 --- Comment #1 from tangyixuan --- Hi, I replace the ‘int32_t’ with other identifier(here I replaced that with abc): 1st case: cat s.c typedef int abc; static abc * const f1(void); gcc-trunk -c -Wignored-qualifiers s.c s.c:2:8: warning: type qu

[Bug c/91839] missing error diagnosis for undeclared identifier

2019-11-27 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91839 --- Comment #1 from tangyixuan --- Hi, there still exists the above error defect in recent GCC: no error suggestions about ‘l_2’. The reduced code is as follow: static long a //error static int f1(void; //error static int f1(void) {

[Bug c/90632] Incorrect error diagnosis of variable declaration

2019-11-27 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90632 --- Comment #1 from tangyixuan --- Hi: I think the superfluous error information of ‘a’ in the above code is fixed in gcc-trunk. $ gcc-trunk -c s.c s.c:1:13: error: expected ‘;’ before ‘static’ 1 | static int c | ^

[Bug c/92479] missing warnings for unreachable codes with -Wunreachable-code

2019-11-13 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92479 --- Comment #4 from tangyixuan --- (In reply to Eric Gallager from comment #2) > (In reply to Andrew Pinski from comment #1) > > The code for Wunreachable-code was removed a long time ago (around 5-10 > > years ago). > > There are some other bug

[Bug c/92479] missing warnings for unreachable codes with -Wunreachable-code

2019-11-13 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92479 --- Comment #3 from tangyixuan --- (In reply to Andrew Pinski from comment #1) > The code for Wunreachable-code was removed a long time ago (around 5-10 > years ago). Thanks for your time, Andrew. I didn't notice that the -Wunreachable-code is i

[Bug c/92479] New: missing warnings for unreachable codes with -Wunreachable-code

2019-11-12 Thread tangyixuan at mail dot dlut.edu.cn
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, there is no warning for the unreachable code with [-Wunreachable-code] as follow. Would it be better to warn developers if the

[Bug c/92392] New: -Wignored-qualifiers points to diff location

2019-11-06 Thread tangyixuan at mail dot dlut.edu.cn
Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- The column of -Wignored-qualifiers warnings are different and not precise for the two similar codes: $: cat s.c typedef int int32_t; static int32_t * const f1(void

[Bug c/92378] New: missing -Warray-bounds warning

2019-11-05 Thread tangyixuan at mail dot dlut.edu.cn
Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, I have two questions for the following: 1. Array a[3] is out of bound, there is no warnings compiled with -ftree-vrp -Warray-bounds=1. When compiled with -Wall with O1/O2/O3, there

[Bug c/92210] New: no warning for invariable used in loop condition

2019-10-24 Thread tangyixuan at mail dot dlut.edu.cn
: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- There is no warning for an invariable used in loop condition: $: cat s.c int main(){ for(int i = 0; i <2;){ } } $: gcc-trunk -Wall -Wextra -pedantic -c s.c

[Bug c/92209] New: Imprecise column number for -Wstrict-prototypes

2019-10-24 Thread tangyixuan at mail dot dlut.edu.cn
Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- GCC outputs a wrong column number of a declared function warning: $ gcc-trunk -Wstrict-prototypes -c s.c s.c:1:1: warning: function declaration isn’t a prototype

[Bug c/92118] New: warning with [-Wmaybe-uninitialized] in -O1

2019-10-16 Thread tangyixuan at mail dot dlut.edu.cn
Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- [-Wmaybe-uninitialized] should be independent of optimization levels (-O0/O1/../O3) or may be a spurious Warnings on -O1: $ cat s.c int main() { int i; for(;i&l

[Bug c/92021] New: no warning with -Wlogical-op

2019-10-08 Thread tangyixuan at mail dot dlut.edu.cn
Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- gcc-7.4 falls to emit the warning for the following: $ cat s.c int main(){ unsigned long a = 8UL; if(~a || a){ } return 0; } $ gcc-7.4 -Wlogical-op s.c Target

[Bug c/91839] New: missing error diagnosis for undeclared identifier

2019-09-20 Thread tangyixuan at mail dot dlut.edu.cn
: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- GCC-trunk omits the error dignosis about "l_2" in the following error code: $ cat s.c static long a//error static int f

[Bug c/91820] missing error diagnosis of '&' in initialization

2019-09-19 Thread tangyixuan at mail dot dlut.edu.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91820 --- Comment #3 from tangyixuan --- (In reply to Andrew Pinski from comment #1) > does adding -pedantic help? Thanks for your reply. When I add -padantic, gcc-trunk reports warning : 2:45: warning:initialization of ‘volatile int * volatile* const

[Bug c/91820] New: missing error diagnosis of '&' in initialization

2019-09-19 Thread tangyixuan at mail dot dlut.edu.cn
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- GCC-trunk do not report the error diagnosis when there misses '&' in the initialization. For example: $: cat s.c static volatile int * v

[Bug c/90632] New: Incorrect error diagnosis of variable declaration

2019-05-25 Thread tangyixuan at mail dot dlut.edu.cn
: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- GCC reports incorrect error diagnosis for error recovery. For the following example, GCC should not report the undeclared variable after error recovery when

[Bug c/90630] New: missing error diagnosis of redundant parenthesis

2019-05-25 Thread tangyixuan at mail dot dlut.edu.cn
: c Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- GCC 4.3.0, 4.4.3, 6.1.0, and 7.1.0 do not report the error diagnosis when there is a redundant parenthesis token in the following scenario, as well as several other