using -ftracer stops buildworld at shutdown.c
From: jason henson (jason_at_ec.rr.com)
Date: 07/27/05
- Previous message: Sam Leffler: "Re: Atheros, hardware access layer, collisions"
- Next in thread: Stefan Farfeleder: "Re: using -ftracer stops buildworld at shutdown.c"
- Reply: Stefan Farfeleder: "Re: using -ftracer stops buildworld at shutdown.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 26 Jul 2005 18:46:55 -0400 To: hackers@freebsd.org
Adding -ftracer to my make.conf causes problems with
/src/sbin/shutdown/shutdown.c
This is my make.conf settings
CPUTYPE=athlon-xp
CFLAGS=-O2 -pipe -ffast-math -funroll-loops -ftracer
COPTFLAGES=-O2 -pipe -funroll-loops -ffast-math -ftracer
Doing a little research I found these items:
-ftracer
Perform tail duplication to enlarge superblock size. This
transformation simplifies the control flow of the function allowing
other optimizations to do better job.
Why do I get "warning: variable (or argument) `blah' might be
clobbered by `longjmp' or `vfork'" and how do I fix it?
When the C runtime executes a longjmp, the flow of control passes back
to the last setjmp that was executed. In the process, the stack (which
contains arguments and local variables) must be 'unwound', that is,
returned to the exact same state that it was in when setjmp was executed.
Unfortunately, due to optimizations such as storing the value of a
variable in a register instead of on the stack, the compiler cannot
always guarantee that the stack will be restored precisely to its
original state. Thus some local variables and/or arguments can be
'clobbered'.
To avoid this warning, the variables and/or arguments should be
prevented from being optimized by declaring them as volatile.
So I sprinkled some volatiles around, but mostly got more errors that
said "gcc volatile discards qualifiers from pointer target type" in the
fprintf functions.
The error went away after I removed -ftracer, but from what I have read
it would be advantageous to change the variable pf to be stored on the
stack and not in a register. That is if it is not stored on the stack.
I did a search of all the listed include files in shutdown.c and found
no matches for pf.
Anyone one have any thoughts or insights on this? Am I completely off
in left field?
Jason
===> sbin/shutdown (all)
cc -O2 -pipe -DNOPROFILE -ffast-math -ftracer -funroll-loops
-march=athlon-xp -Wsystem-headers -Werror -Wall -Wno-format-y2k -W
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch
-Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline
-Wnested-externs -Wredundant-decls -c /usr/src/sbin/shutdown/shutdown.c
/usr/src/sbin/shutdown/shutdown.c: In function `timewarn':
/usr/src/sbin/shutdown/shutdown.c:276: warning: variable 'pf' might be
clobbered by `longjmp' or `vfork'
*** Error code 1
Stop in /usr/src/sbin/shutdown.
*** Error code 1
Stop in /usr/src/sbin.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Sam Leffler: "Re: Atheros, hardware access layer, collisions"
- Next in thread: Stefan Farfeleder: "Re: using -ftracer stops buildworld at shutdown.c"
- Reply: Stefan Farfeleder: "Re: using -ftracer stops buildworld at shutdown.c"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Clear Stack
... To unwind the stack, just raise an exception that's handled by a procedure ...
Reserve a dedicated error code for this ... In all your local error handlers, test for
this explicit error code. ... That reserved error code will eventually find its way to
your root ... (microsoft.public.vb.general.discussion) - Re: integer pthread_t vs. DCE threads
... that the stack is difficult to impossible to sensibly virtualize and ... the
library needs to put down ... This is one of the problems with globals. ...
replaced with a meaningless error code. ... (comp.programming.threads) - Re: Updated procstat(1)
... *** Error code 1 ... -stack_save(struct stack *st) ...
+static void ... (freebsd-hackers) - Re: LAM/MPI MPICH-2 Compatibility
... Here is the error code that I have obtained: ... which says that, for example,
the first "process is dead" message ... consistent with the messages about call
stack, ... (comp.parallel.mpi) - 128 Return Code
... I have a C++ program that executes a command line through the system ...
I will get a 128 error code. ... without prg2 ever executing. ... (microsoft.public.vc.language)