On Fri, 19 Nov 2021, Bernhard Reutner-Fischer wrote: > On Fri, 19 Nov 2021 10:35:26 +0100 (CET) > Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > > On Fri, 19 Nov 2021, Alexandre Oliva wrote: > > > > > On Nov 18, 2021, Richard Biener <rguent...@suse.de> wrote: > > > > > > > IMHO a more reasonable thing to do would be to not treat > > > > -o /dev/null as a source for -dumpdir and friends. Alex? > > > > > > +1 > > > > > > I think we already have some special-casing for /dev/null somewhere. > > > > Grepping finds me the following in system.h which is already checked > > for in gcc.c in a few places indeed. > > > > /* Provide a default for the HOST_BIT_BUCKET. > > This suffices for POSIX-like hosts. */ > > > > #ifndef HOST_BIT_BUCKET > > #define HOST_BIT_BUCKET "/dev/null" > > #endif > > > > > > > > You did the last re-org, where'd we put such special casing? > > > > > > I think we're missing something like this, to avoid messing with dumpdir > > > with -o /dev/null. We already use the same function when computing > > > outbase just below this. > > > > Ah yeah, not_actual_file_p should do the trick indeed. Giuliano, can > > you update the patch like below? I think we should still adjust > > documentation as you did. > > But that wouldn't cater for the general problem that the dumpdir is not > writable, no? Why not just simply check access W_OK of the dumpdir? > > Otherwise a dumpdir /dev/full or anyother such path will cause the same > thing i guess.
I think those cases are OK to diagnose. Just choosing a not_actual_file_p output as base to derive the dump directory is bad. Richard.