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]

Re: [dave@hiauly1.hia.nrc.ca: Incorrect file name simplication]


> What do you suggest we do here?  It's a pathname-simplification-
> doesn't-work-with-symlinks issue.
> 
> I can revert to the old way with something like
> 
> +  if (!IS_ABSOLUTE_PATHNAME (name))
>     _cpp_simplify_pathname (name);
> 
> in cppfiles.c.  However, I remain uneasy about the optimisation since it
> does get these things wrong.  I recognise it fixes an aliasing issue that
> occurs without pathname simplification - but this is only an efficiency
> gain not a correctness issue, except for the minor cases of #import and
> #pragma once.  In other words, I tend to think we should get it right
> (ignoring #import / #pragma once) rather than be faster but get it wrong
> sometimes.

This doesn't look completely optimal to me.  Possibly, _cpp_simplify_pathname
can be fixed to only transform `/..' in an absolute path in the case
`/../quux'.  I am trying a patch. 

Dave
--
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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