Bug 31586 - -falign-X and -fno-align-X flags have reversed meaning
-falign-X and -fno-align-X flags have reversed meaning
Status: UNCONFIRMED
Product: gcc
Classification: Unclassified
Component: middle-end
4.1.2
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-16 10:17 UTC by Kenneth Hoste
Modified: 2007-04-16 10:25 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Hoste 2007-04-16 10:17:28 UTC
The documentation mentions: 

-falign-functions=n

"-fno-align-functions and -falign-functions=1 are equivalent and mean that functions will not be aligned."
and

"If n is not specified or is zero, use a machine-dependent default."

But, it seems the semantics are reversed when using -fno-align-functions and -falign-functions. In gcc/opts.c:handle_option, the value variable is set to 1 by default (for -f<flag> flags), and to 0 for -fno-<flag> flags. Sadly, this should be reversed for falign-X flags: 1 should be used for -fno-align-X and 0 for -falign-X . 

This affects -falign-functions, -falign-jumps, -falign-labels and -falign-loops, and should be fairly easy to solve to flip the value of 'value' in handle_option for the -falign-X flags.