https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123374
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Keywords|needs-source |needs-reduction
Status|UNCONFIRMED |NEW
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Basically waccess2 is now able to warn of the __builtin_constant_p part of
extern __inline __attribute__ ((__always_inline__)) __attribute__
((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__
((__warn_unused_result__)) ssize_t
read (int __fd, void * __buf, size_t __nbytes)
{
return (((__builtin_constant_p (__builtin_dynamic_object_size (__buf, 0)) &&
(__builtin_dynamic_object_size (__buf, 0)) == (long unsigned int) -1) ||
(((__typeof (__nbytes)) 0 < (__typeof (__nbytes)) -1 || (__builtin_constant_p
(__nbytes) && (__nbytes) > 0)) && __builtin_constant_p ((((long unsigned int)
(__nbytes)) <= ((__builtin_dynamic_object_size (__buf, 0))) / ((sizeof
(char))))) && (((long unsigned int) (__nbytes)) <=
((__builtin_dynamic_object_size (__buf, 0))) / ((sizeof (char)))))) ?
__read_alias (__fd, __buf, __nbytes) : ((((__typeof (__nbytes)) 0 < (__typeof
(__nbytes)) -1 || (__builtin_constant_p (__nbytes) && (__nbytes) > 0)) &&
__builtin_constant_p ((((long unsigned int) (__nbytes)) <=
(__builtin_dynamic_object_size (__buf, 0)) / (sizeof (char)))) && !(((long
unsigned int) (__nbytes)) <= (__builtin_dynamic_object_size (__buf, 0)) /
(sizeof (char)))) ? __read_chk_warn (__fd, __buf, __nbytes,
__builtin_dynamic_object_size (__buf, 0)) : __read_chk (__fd, __buf, __nbytes,
__builtin_dynamic_object_size (__buf, 0))))
;
}
Which it was not able to do before (why don't know and don't care).
WE don't resolve __builtin_constant_p until vrp2 .
So maybe waccess2 should be moved after vrp2 or have better control of the
warnings that are conditionalized by __builtin_constant_p .