Re: [PATCH v2] Add strict aliasing warning when inlining function.

2014-08-19 Thread lin zuojian
Here is the warning after my patch: 1.cpp: In function 'int foo(int, int, int)': 1.cpp:29:70: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] return hash2(static_cast(change1), len / 2);

Re: [PATCH v2] Add strict aliasing warning when inlining function.

2014-08-19 Thread lin zuojian
Hi Richard, > Generally I don't think we want to expand the use of the IMHO broken > strict_aliasing_warning code. If you have read my test code, you must understand it is the programmer who responsible for this undefined behavior, instead of the compiler. Like PR 60546 concluded.

Re: [PATCH v2] Add strict aliasing warning when inlining function.

2014-08-19 Thread Richard Biener
On Tue, Aug 19, 2014 at 7:20 AM, lin zuojian wrote: > Hi, > Here patch v2. Move the function as Andrew instructed. > > * tree-inline.c (setup_one_parameter): Add strict aliasing check. > * c-family/c-common.c (strict_aliasing_warning): Move to alias.c. > * c-family/c-common.h (stri

Re: [PATCH v2] Add strict aliasing warning when inlining function.

2014-08-18 Thread lin zuojian
Hi, Here patch v2. Move the function as Andrew instructed. * tree-inline.c (setup_one_parameter): Add strict aliasing check. * c-family/c-common.c (strict_aliasing_warning): Move to alias.c. * c-family/c-common.h (strict_aliasing_warning): Move to tree.h. * alias.c (strict_alia