Git Product home page Git Product logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Note that GCC sometimes optimizes variables in frontend regardless of 
optimization level.

Original comment by [email protected] on 22 May 2015 at 6:35

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
But why '-fsanitize=address' changes optimizations?

It's possible that it's something with gcc internals, but ever since I'm 
working on pretty big C89 project compiled on gcc-s 2.95.3-5.1 I've *never* 
encountered '<optimized out>' without '-O' switch, especially with a '-g' one…

That variable should not be optimized out since it's passed around and written 
into. Any combination of '-O' and  '-g' switches  doesn't stop it from 
„disappearing”, also making the variable volatile (!). Only disabling ASAN.


Original comment by [email protected] on 22 May 2015 at 7:07

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Ah, sorry, I thought you meant t. I've check compiler dumps with 
-fdump-tree-all and it looks like d is preserved by ASan:

 $ cat test.c.169t.optimized
 ...
 ;; Function main (main, funcdef_no=3, decl_uid=2584, symbol_order=3)

 main ()
 {
   <bb 2>:
   d = 4;
   t = "";
   fun_wr (&d);

Perhaps GCC has some problem when generating debuginfo? Could you file a bug in 
GCC bugzilla?

Original comment by [email protected] on 22 May 2015 at 7:49

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Already did. Year ago :-(

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61071

I don't think it's a problem with debuginfo, since decreasing size of t by one 
makes printing the d variable work again.

Original comment by [email protected] on 22 May 2015 at 8:01

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Does this work with fresh clang? 
I afraid that this is gcc-specific and there is little we can do on asan side. 

Original comment by [email protected] on 22 May 2015 at 5:44

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
> Does this work with fresh clang? 
Yeah, clang produces debugable binary.
clang version 3.6.0 (tags/RELEASE_360/final)

> I afraid that this is gcc-specific and there is little we can do on asan 
side. 
I understand. Thanks for your time, though.

Original comment by [email protected] on 25 May 2015 at 5:18

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 21, 2024
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by [email protected] on 30 Jul 2015 at 9:06

  • Added labels: ProjectAddressSanitizer

from address-sanitizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.