[Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"

2005-11-25 Thread gdr at gcc dot gnu dot org


--- Comment #4 from gdr at gcc dot gnu dot org  2005-11-26 07:44 ---
(In reply to comment #2)
> Hmm, sort of.  The call of g(i) also warns with "is used", although I 
> think it might deserve only a "may be used".  But anyway I think that 
> this nevertheless has different causes.  It's not the call creating 
> the problem, but the copy itself. 

yes, how a is copy not a use?  At the very list, on modern architectures,
it implies memory->register->memory traffic of garbage data.


-- 

gdr at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||gdr at gcc dot gnu dot org


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



[Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"

2005-06-27 Thread schwab at suse dot de

--- Additional Comments From schwab at suse dot de  2005-06-27 13:57 ---
In the case of g(i) you have an initialisation of the parameter variable which 
already constitutes a use of the value. 

-- 


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


[Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"

2005-06-27 Thread matz at suse dot de

--- Additional Comments From matz at suse dot de  2005-06-27 13:50 ---
Hmm, sort of.  The call of g(i) also warns with "is used", although I 
think it might deserve only a "may be used".  But anyway I think that 
this nevertheless has different causes.  It's not the call creating 
the problem, but the copy itself.  On could for instance delete the 
call and instead make 'testarray' volatile (so that the copy is not 
optimized away).  This would still warn, IMHO incorrectly. 
 
What's even stranger is, that if I add a call "forget(testvar)" then 
the warning vanishes.  I.e. like so: 
- 
int main() { 
struct testme volatile testarray[1]; 
struct testme testvar; 
testvar.testval = 0; 
testarray[0] = testvar; 
forget (testvar); 
return 0; 
} 
- 
 
So this shows that not the call on a partly initialized struct is the 
problem (because that is still the case with the above), but something 
in SRA dealing with the copy.  If one removes the call to forget above 
the warning will return (note the added volatile) on the copy. 

-- 


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


[Bug middle-end/22197] invalid "is" used uninitialized, should be "may be"

2005-06-27 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-27 
13:31 ---
but isn't that the same as (except it is an aggregate in the case in comment 
#1):
void g(int);
void f(void)
{
 int i;
  g(i);
}

because g might not look at the agrument value?

-- 
   What|Removed |Added

   Severity|normal  |minor
   Keywords||diagnostic


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