http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60741

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-04-03
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #1)
> We don't warn for fb(), because PR18501.
> 
> So the only original bug here is the location when warning. The problem is
> the locations that are propagated when transforming expressions. We reach:
> 
>   # n_4 = PHI <n_5(D)(3), [test.cc : 6:17] 1(6), [test.cc : 7:17] 2(4)>
> <L3>:
>   [test.cc : 20:32] # RANGE [-2147483648, 2147483647] NONZERO
> 0x00000000000000007
>   _2 = n_4 + 1;
> 
> When instead we should have a location for n_4 that is different than the
> location for '+'.

The location of n_4 depends on the edge you are coming from (thus n_4
itself doesn't have a location). The warning code picks the location of an
actual
use of n_4 in that case, here that of

  _2 = n_4 + 1;

this points to the plus in main, but appearantly slightly wrong.  At the
point where we emit the warning we can't really do better, but we could at
least also hint where 'n' was declared and/or inlined from.

> In any case, pointing to the closing parenthesis is very confusing. At worst
> it should point to the '+'.

Reply via email to