This is the mail archive of the gcc@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]

Re: copy_rtx() bug (?)


Le 1997-10-01, Thomas Koenig écrivait :

> Just continuing to comb through cc1 with Checker...
[...]
> 320                 XEXP (copy, i) = copy_rtx (XEXP (orig, i));
> 321               break;
> 322
> 323             case '0':
> 324             case 'u':
> 325               XEXP (copy, i) = XEXP (orig, i);
>                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 326               break;
[...]
> Obviously, orig->fld[1].rtx has not been initialized (it's all zeroes
> in this case):
> 
> (gdb) p orig->fld[1]
> $14 = {rtwint = 0, rtint = 0, rtstr = 0x0, rtx = 0x0, rtvec = 0x0, 
>   rttype = VOIDmode}
You can try to delay the warning by using bcopy or memcpy to copy the rtx.
In this case, Checker will only copy the right of the memory.  As a consequence
no warning would be issued at line 325, and furthermore, reading uninitialized
fields of 'copy' would produce warnings.

Perhaps this would be fixed with gcc Checker.

Tristan.


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