This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/41097] Inlined variable debug location disappears when ptr type



------- Comment #2 from mark at gcc dot gnu dot org  2009-08-18 08:11 -------
(In reply to comment #1)
> Wait a second are you saying:
> volatile char * p_name 
> 
> and p_name disappears?
> Well that is because p_name is no longer volatile but what it points to is.

Well, obvious p_name still is there, since it will be put in a register to feed
into the asm statement. But the debuginfo location for it is missing.

> I don't think this is a bug in GCC but rather a misunderstanding on how
> qualifiers apply to types.
>
> If you use a typedef for char*, does it disappear?

You are right, I misunderstood how the volatile qualifier "attached" to the
type. Using:

  typedef char * char_ptr;
  volatile char_ptr p_name = (char_ptr) name;

Does what I want. Thanks. That will allow me to write a workaround for what I
am seeing using typedef typeof(arg).

I am not sure this means the bug is really not there, because I am still a
little surprised (confused?) the location expression goes missing in the
original (and I assume the variable isn't actually fully optimized away). But
since I now have a workaround for that I am already happy. Thanks.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]