public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32528] New: -save-temps when compiling standard input fails
@ 2007-06-27 23:05 mec at google dot com
2007-11-13 3:27 ` [Bug c/32528] " manu at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: mec at google dot com @ 2007-06-27 23:05 UTC (permalink / raw)
To: gcc-bugs
This looks like a trivial bug in options processing. It's been not working for
a long time.
===
mec@hollerith:~/exp-save-temps-dash$ cat hello.c
#include <stdio.h>
int main()
{
printf("Hello, world\n");
return 0;
}
mec@hollerith:~/exp-save-temps-dash$ cat hello.c |
/home/mec/gcc-3.4.6/install/bin/gcc -save-temps -x c -
cc1: error: unrecognized command line option "-.i"
mec@hollerith:~/exp-save-temps-dash$ cat hello.c |
/home/mec/gcc-4.0.4/install/bin/gcc -save-temps -x c -
cc1: error: unrecognized command line option "-.i"
mec@hollerith:~/exp-save-temps-dash$ cat hello.c |
/home/mec/gcc-4.1.2/install/bin/gcc -save-temps -x c -
cc1: error: unrecognized command line option "-.i"
mec@hollerith:~/exp-save-temps-dash$ cat hello.c |
/home/mec/gcc-4.2.0/install/bin/gcc -save-temps -x c -
cc1: error: unrecognized command line option "-.i"
mec@hollerith:~/exp-save-temps-dash$ cat hello.c |
/home/mec/gcc-4.3-20070622/install/bin/gcc -save-temps -x c -
cc1: error: unrecognized command line option "-.i"
mec@hollerith:~/exp-save-temps-dash$
--
Summary: -save-temps when compiling standard input fails
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mec at google dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
@ 2007-11-13 3:27 ` manu at gcc dot gnu dot org
2007-11-13 4:46 ` dsh at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-13 3:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from manu at gcc dot gnu dot org 2007-11-13 03:27 -------
This is confirmed. I think the problem is in the specs in gcc.c:
%{!combine:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
%(cc1_options)}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
when cc1 -fpreprocessed %{save-temps:%b.i} is expanded to cc1 -fpreprocessed
-.i
No idea how this can be fixed without a "--" or an "--input" option.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-11-13 03:27:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
2007-11-13 3:27 ` [Bug c/32528] " manu at gcc dot gnu dot org
@ 2007-11-13 4:46 ` dsh at gcc dot gnu dot org
2007-11-13 4:51 ` dsh at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dsh at gcc dot gnu dot org @ 2007-11-13 4:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dsh at gcc dot gnu dot org 2007-11-13 04:46 -------
Created an attachment (id=14537)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14537&action=view)
Idea for a fix
I started on a patch for this a few months ago. It basically just prepended ./
to all the temporary file names. Attached. I doubt it will still apply right
off the bat, but just take it as an idea for a fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
2007-11-13 3:27 ` [Bug c/32528] " manu at gcc dot gnu dot org
2007-11-13 4:46 ` dsh at gcc dot gnu dot org
@ 2007-11-13 4:51 ` dsh at gcc dot gnu dot org
2007-11-13 5:00 ` manu at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: dsh at gcc dot gnu dot org @ 2007-11-13 4:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dsh at gcc dot gnu dot org 2007-11-13 04:50 -------
Created an attachment (id=14538)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14538&action=view)
Better patch
Sorry, this one's cleaner. That other one included some other cleanup that I
think already went in.
--
dsh at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #14537|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
` (2 preceding siblings ...)
2007-11-13 4:51 ` dsh at gcc dot gnu dot org
@ 2007-11-13 5:00 ` manu at gcc dot gnu dot org
2007-11-13 5:03 ` manu at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-13 5:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from manu at gcc dot gnu dot org 2007-11-13 05:00 -------
(In reply to comment #3)
> Created an attachment (id=14538)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14538&action=view) [edit]
> Better patch
>
Please, bootstrap and run the testsuite, then send the patch to
gcc-patches@gcc.gnu.org. You will also need a changelog entry.
Thanks!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
` (3 preceding siblings ...)
2007-11-13 5:00 ` manu at gcc dot gnu dot org
@ 2007-11-13 5:03 ` manu at gcc dot gnu dot org
2007-12-17 15:26 ` manu at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-13 5:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from manu at gcc dot gnu dot org 2007-11-13 05:03 -------
(In reply to comment #2)
> Created an attachment (id=14537)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14537&action=view) [edit]
> Idea for a fix
>
> I started on a patch for this a few months ago. It basically just prepended ./
> to all the temporary file names. Attached. I doubt it will still apply right
> off the bat, but just take it as an idea for a fix.
>
If this approach is deemed suitable, then I think a better fix would be to
build the %b substitution with ./ prefixed already.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
` (4 preceding siblings ...)
2007-11-13 5:03 ` manu at gcc dot gnu dot org
@ 2007-12-17 15:26 ` manu at gcc dot gnu dot org
2007-12-17 15:49 ` bonzini at gnu dot org
2008-01-25 21:16 ` rguenth at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-12-17 15:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from manu at gcc dot gnu dot org 2007-12-17 15:26 -------
*** Bug 34479 has been marked as a duplicate of this bug. ***
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bonzini at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
` (5 preceding siblings ...)
2007-12-17 15:26 ` manu at gcc dot gnu dot org
@ 2007-12-17 15:49 ` bonzini at gnu dot org
2008-01-25 21:16 ` rguenth at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: bonzini at gnu dot org @ 2007-12-17 15:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from bonzini at gnu dot org 2007-12-17 15:48 -------
re. comment #5, like this?
Index: gcc.c
===================================================================
--- gcc.c (revision 128902)
+++ gcc.c (working copy)
@@ -4685,6 +4685,8 @@ do_spec_1 (const char *spec, int inswitc
fatal ("spec '%s' invalid", spec);
case 'b':
+ if (!IS_ABSOLUTE_PATH (input_basename[0]) && input_basename[0] ==
'-')
+ obstack_grow (&obstack, "./", 2);
obstack_grow (&obstack, input_basename, basename_length);
arg_going = 1;
break;
Anybody wants to bootstrap/test/regtest this?
Paolo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/32528] -save-temps when compiling standard input fails
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
` (6 preceding siblings ...)
2007-12-17 15:49 ` bonzini at gnu dot org
@ 2008-01-25 21:16 ` rguenth at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-25 21:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2008-01-25 20:59 -------
*** Bug 20197 has been marked as a duplicate of this bug. ***
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cgweav at email dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-01-25 21:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-27 23:05 [Bug c/32528] New: -save-temps when compiling standard input fails mec at google dot com
2007-11-13 3:27 ` [Bug c/32528] " manu at gcc dot gnu dot org
2007-11-13 4:46 ` dsh at gcc dot gnu dot org
2007-11-13 4:51 ` dsh at gcc dot gnu dot org
2007-11-13 5:00 ` manu at gcc dot gnu dot org
2007-11-13 5:03 ` manu at gcc dot gnu dot org
2007-12-17 15:26 ` manu at gcc dot gnu dot org
2007-12-17 15:49 ` bonzini at gnu dot org
2008-01-25 21:16 ` rguenth at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).