[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2019-12-10 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

--- Comment #10 from Eric Gallager  ---
This might be material for David Malcolm's new static analyzer

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2019-06-11 Thread Hi-Angel at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

Konstantin Kharlamov  changed:

   What|Removed |Added

 CC||Hi-Angel at yandex dot ru

--- Comment #9 from Konstantin Kharlamov  ---
In recent news: "Arch Linux Drops GCC 9 From Testing Due To BCache Corruption
Bug"¹

The "gcc bug" turned out to be a bug in bcachefs with a pointer to an
out-of-scope variable.²

I just want to note, that lack of this warning is more important than one would
think. Had GCC warned about the bcachefs problem, it wouldn't get so much blame
on news sites.

1:
https://www.phoronix.com/scan.php?page=news_item=Arch-GCC9-BCache-Corruption-Hit
2: https://bugzilla.kernel.org/show_bug.cgi?id=203573#c6

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2018-02-16 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

Eric Gallager  changed:

   What|Removed |Added

   Keywords||patch
 CC||egallager at gcc dot gnu.org,
   ||msebor at gcc dot gnu.org

--- Comment #8 from Eric Gallager  ---
(In reply to Andrew Pinski from comment #3)
> Confirmed, I can't seem to find the bug report (I thought there was one).

bug 69433 or bug 82520 perhaps?

(In reply to Jakub Jelinek from comment #7)
> https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00911.html
> https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01331.html
> use-after-scope sanitization should catch this.

I forget, was this added? Adding "patch" keyword in case it wasn't.

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2016-08-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00911.html
https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01331.html
use-after-scope sanitization should catch this.

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2016-08-31 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

--- Comment #6 from Manuel López-Ibáñez  ---
(In reply to Manuel López-Ibáñez from comment #5)
> (In reply to Andrew Pinski from comment #2)
> > This needs data flow to see if b usage cross over the clobber or not.
> 
> I think the simpler case can be warned in the FE. I cannot imagine a correct
> use of assigning a pointer from an inner scope to a variable in the outer
> scope. Even if the pointer is never used, there is not reason to do that.

Actually, forget that. It is obvious this can happen indeed in correct code.
Not sure what I was thinking.

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2016-08-31 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

--- Comment #5 from Manuel López-Ibáñez  ---
(In reply to Andrew Pinski from comment #2)
> This needs data flow to see if b usage cross over the clobber or not.

I think the simpler case can be warned in the FE. I cannot imagine a correct
use of assigning a pointer from an inner scope to a variable in the outer
scope. Even if the pointer is never used, there is not reason to do that.

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2016-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

--- Comment #4 from Andrew Pinski  ---
This also should be detected at runtime with either -fsantizer=undefined or
-fsantizer=address (if it is not, please file another bug for that).

[Bug middle-end/77433] warn about usage of object that outside of the scope of the object

2016-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77433

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-08-31
 Ever confirmed|0   |1

--- Comment #3 from Andrew Pinski  ---
Confirmed, I can't seem to find the bug report (I thought there was one).