[Bug rtl-optimization/96993] [10/11 Regression] invalid code

2020-09-09 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96993

--- Comment #4 from Andrew Pinski  ---
Is there any reason why you didn't use offsetof/__builtin_offsetof here?
Instead of playing tricks like:
(tUint8 *)(&((struct tmm_blk_free_head_t *)0)->ql.column_list)

[Bug rtl-optimization/96993] [10/11 Regression] invalid code

2020-09-09 Thread jan.smets at nokia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96993

--- Comment #3 from Jan Smets  ---
The testcase has a sign-compare warning that we've traditionally been ignoring
given the ancient codebase. 

warning: operand of ‘?:’ changes signedness from ‘int’ to ‘long unsigned int’
due to unsignedness of other operand [-Wsign-compare]

Changing the testcase From:

 ((address_ != (0L)) ? (tUint8 *)(address_) - (tUint8 *)(&((struct
tmm_blk_free_head_t *)0)->ql.column_list) : (uintptr_t)(0L));

To:

 ((address_ != (0L)) ? (uintptr_t)(tUint8 *)(address_) - (uintptr_t)(tUint8
*)(&((struct tmm_blk_free_head_t *)0)->ql.column_list) : (uintptr_t)(0L));

will generate different code in GCC 10, whereas it generates the same code in
GCC 9 for both forms.
 (with the added casts the generated GCC 10 code is good), 


commit 810c42c38d37317c80b57db0a8b6d8991e78ef50
Author: Richard Biener 
Date:   Mon May 20 12:02:35 2019 +

tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR doesn't
produce pointers.

2019-05-20  Richard Biener  

* tree-ssa-structalias.c (find_func_aliases): POINTER_DIFF_EXPR
doesn't produce pointers.
{TRUNC,CEIL,FLOOR,ROUND,EXACT}_{DIV,MOD}_EXPR points to what
the first operand points to.

From-SVN: r271414


I've been trying to get a working/crashing testcase for you, but finding the
right 'input data' to trigger the behavior for my testcase seems a bit
problematic.

[Bug rtl-optimization/96993] [10/11 Regression] invalid code

2020-09-09 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96993

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Can you turn it into a self-contained testcase (add noipa attributes to the
external functions and define them some way that it detects the problem, add
noipa attribute to the problematic function and add main that invokes it so
that it can reproduce)?
Without that and knowledge what to look for, it is not really possible e.g. to
bisect it and find out what changed and why.

[Bug rtl-optimization/96993] [10/11 Regression] invalid code

2020-09-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96993

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.3
Summary|invalid code|[10/11 Regression] invalid
   ||code