Skip to content

Commit

Permalink
Remove -U, which set compiler options but hasn't worked in many years
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Apr 19, 2017
1 parent e83438e commit bc0a0c5
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 148 deletions.
3 changes: 1 addition & 2 deletions cnf/GAP-C-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ fi

# invoke GAP in compiler mode
echo "#ifndef AVOID_PRECOMPILED" > "$C_FILE.tmp"
"$GAPBIN" -U FAST_PLAIN_LISTS,FAST_INT_ARITH \
-C "*stdout*" \
"$GAPBIN" -C "*stdout*" \
"$GAP_FILE" \
"Init_$STEM" \
GAPROOT/lib/$STEM.g >> "$C_FILE.tmp"
Expand Down
51 changes: 2 additions & 49 deletions cnf/gac.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,6 @@
##
## The option '-save-temps' tells 'gac' to not delete any intermediate files
##
## The option '-ffast-int-arith' tells 'gac' to emit code for arithmetic
## operations, which works faster if both operands are small integers and
## slower otherwise.
##
## The option '-ffast-plain-lists' tells 'gac' to emit code for list access,
## which works faster if the list is a plain list and slower otherwise.
##
## The option '-ffast-list-funcs' tells 'gac' to inline the functions 'Add'
## and 'Length' the code, which makes it a bit faster.
##
## The option '-fno-check-types' tells 'gac' to emit no error checks for
## list access, which makes it faster but may dump core if an error happens.
#
## The option '-p <option>' tells 'gac' to pass the option <option> to the
## C compiler.
##
Expand Down Expand Up @@ -82,9 +69,6 @@ gap_compiler="${gap_bin}/gap"
# is evaluated relative to this
gap_binary="${gap_bin}"

# options to pass to the GAP executable when it is invokes as compiler
gap_options=""

libtool="$SHELL $abs_top_builddir/libtool"
CC="@CC@"

Expand Down Expand Up @@ -113,8 +97,8 @@ OBJECTS="@OBJECTS@"
#F gap_compile <output> <input> <module-name> <identifier>
##
gap_compile () {
echo ${gap_compiler} ${gap_options} -C $1 $2 $3 $4
${gap_compiler} ${gap_options} -C "$1" "$2" "$3" "$4"
echo ${gap_compiler} -C $1 $2 $3 $4
${gap_compiler} -C "$1" "$2" "$3" "$4"
}


Expand Down Expand Up @@ -298,37 +282,6 @@ while [ $# -gt 0 ]; do

-save-temps) savetemps="true";;

-ffast-int-arith) if [ "X${gap_options}" = "X" ]; then
gap_options="-U FAST_INT_ARITH"
else
gap_options="${gap_options},FAST_INT_ARITH"
fi;;

-ffast-plain-lists) if [ "X${gap_options}" = "X" ]; then
gap_options="-U FAST_PLAIN_LISTS"
else
gap_options="${gap_options},FAST_PLAIN_LISTS"
fi;;

-ffast-list-funcs) # echo "$0: option $1 is not currently allowed, ignoring it";;
if [ "X${gap_options}" = "X" ]; then
gap_options="-U FAST_LIST_FUNCS"
else
gap_options="${gap_options},FAST_LIST_FUNCS"
fi;;

-fno-check-types) if [ "X${gap_options}" = "X" ]; then
gap_options="-U NO_CHECK_TYPES"
else
gap_options="${gap_options},NO_CHECK_TYPES"
fi;;

-fno-check-list-elms) if [ "X${gap_options}" = "X" ]; then
gap_options="-U NO_CHECK_LIST_ELMS"
else
gap_options="${gap_options},NO_CHECK_LIST_ELMS"
fi;;

-f*) echo "$0: no such option '$1'"
exit 1;;

Expand Down
3 changes: 1 addition & 2 deletions doc/ref/run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,9 @@ If a file cannot be opened &GAP; will print an error message and will abort.
</List>
<P/>
<Index Subkey="command line, internal">options</Index>
<Index Key="-C"><C>-C</C></Index><Index Key="-U"><C>-U</C></Index>
<Index Key="-P"><C>-P</C></Index><Index Key="-W"><C>-W</C></Index>
<Index Key="-z"><C>-z</C></Index><Index Key="-p"><C>-p</C></Index>
Additional options, <C>-C</C>, <C>-U</C>, <C>-P</C>, <C>-W</C>, <C>-p</C>
Additional options, <C>-C</C>, <C>-P</C>, <C>-W</C>, <C>-p</C>
and <C>-z</C> are used
internally by the <Package>gac</Package> script (see <Ref Label="Kernel modules"/>)
and/or on specific operating systems.
Expand Down
1 change: 0 additions & 1 deletion hpcgap/lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ BIND_GLOBAL( "GAPInfo", AtomicRecord(rec(
,
rec( short:= "p", default := false, help := ["enable/disable package output mode"] ),
rec( short := "E", default :=false ),
rec( short := "U", default := "" ), # -C -U undocumented options to the compiler
rec( short := "s", default := "4g" ),
rec( short := "z", default := "20" ),
rec( long := "prof", default := "", arg := "<file>",
Expand Down
2 changes: 0 additions & 2 deletions hpcgap/src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ int realmain( int argc, char * argv[], char * environ[] )
}
func = READ_AS_FUNC();
crc = SyGAPCRC(SyCompileInput);
if (strlen(SyCompileOptions) != 0)
SetCompileOpts(SyCompileOptions);
type = CompileFunc(
SyCompileOutput,
func,
Expand Down
8 changes: 0 additions & 8 deletions hpcgap/src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ Char SyCompileName[256];
*/
Char SyCompileOutput[GAP_PATH_MAX];

/****************************************************************************
**
*V SyCompileOutput . . . . . . . . . . . . . . . . . . into this output file
*/
Char SyCompileOptions[256] = {'\0'};


/****************************************************************************
**
*V SyCompilePlease . . . . . . . . . . . . . . . tell GAP to compile a file
Expand Down Expand Up @@ -1765,7 +1758,6 @@ struct optInfo options[] = {
{ 'M', "", toggle, &SyUseModule, 0}, /* must be handled in kernel */
{ 'X', "", toggle, &SyCheckCRCCompiledModule, 0}, /* must be handled in kernel */
{ 'R', "", unsetString, &SyRestoring, 0}, /* kernel */
{ 'U', "", storeString, SyCompileOptions, 1}, /* kernel */
{ 'a', "", storeMemory, &preAllocAmount, 1 }, /* kernel -- is this still useful */
{ 'e', "", toggle, &SyCTRD, 0 }, /* kernel */
{ 'f', "", forceLineEditing, (void *)2, 0 }, /* probably library now */
Expand Down
6 changes: 0 additions & 6 deletions hpcgap/src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ extern Char SyCompileName[256];
*/
extern Char SyCompileOutput[GAP_PATH_MAX];

/****************************************************************************
**
*V SyCompileOptions . . . . . . . . . . . . . . . . . with these options
*/
extern Char SyCompileOptions[256];


/****************************************************************************
**
Expand Down
1 change: 0 additions & 1 deletion lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ BIND_GLOBAL( "GAPInfo", rec(
,
rec( short:= "p", default := false, help := ["enable/disable package output mode"] ),
rec( short := "E", default :=false ),
rec( short := "U", default := "" ), # -C -U undocumented options to the compiler
rec( short := "s", default := "4g" ),
rec( short := "z", default := "20" ),
rec( long := "prof", default := "", arg := "<file>",
Expand Down
53 changes: 0 additions & 53 deletions src/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,59 +96,6 @@ Int CompCheckTypes ;
*/
Int CompCheckListElements;

/****************************************************************************
**
*V CompOptNames . . names for all the compiler options passed by gac
**
*/

struct CompOptStruc { const Char *extname;
Int *variable;
Int val;};

struct CompOptStruc CompOptNames[] = {
{ "FAST_INT_ARITH", &CompFastIntArith, 1 },
{ "FAST_PLAIN_LISTS", &CompFastPlainLists, 1 },
{ "FAST_LIST_FUNCS", &CompFastListFuncs, 1 },
{ "NO_CHECK_TYPES", &CompCheckTypes, 0 },
{ "NO_CHECK_LIST_ELMS", &CompCheckListElements, 0 }};

#define N_CompOpts (sizeof(CompOptNames)/sizeof(struct CompOptStruc))


/****************************************************************************
**
*F SetCompileOpts( <string> ) . . parse the compiler options from <string>
** and set the appropriate variables
** unrecognised options are ignored for now
*/
#include <ctype.h>

void SetCompileOpts( Char *opts )
{
Char *s = opts;
Int i;
while (*s)
{
while (IsSpace(*s))
s++;
for (i = 0; i < N_CompOpts; i++)
{
if (0 == strncmp(CompOptNames[i].extname,
s,
strlen(CompOptNames[i].extname)))
{
*(CompOptNames[i].variable) = CompOptNames[i].val;
break;
}
}
while (*s && *s != ',')
s++;
if (*s == ',')
s++;
}
return;
}

/****************************************************************************
**
Expand Down
9 changes: 0 additions & 9 deletions src/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ extern Int CompileFunc (
Int magic1,
Char * magic2 );

/****************************************************************************
**
*F SetCompileOpts( <string> ) . . parse the compiler options from <string>
** and set the appropriate variables
** unrecognised options are ignored for now
*/

extern void SetCompileOpts( Char *opts );


/****************************************************************************
**
Expand Down
2 changes: 0 additions & 2 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ int realmain( int argc, char * argv[], char * environ[] )
}
func = READ_AS_FUNC();
crc = SyGAPCRC(SyCompileInput);
if (strlen(SyCompileOptions) != 0)
SetCompileOpts(SyCompileOptions);
type = CompileFunc(
SyCompileOutput,
func,
Expand Down
7 changes: 0 additions & 7 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ Char SyCompileName[256];
*/
Char SyCompileOutput[GAP_PATH_MAX];

/****************************************************************************
**
*V SyCompileOutput . . . . . . . . . . . . . . . . . . into this output file
*/
Char SyCompileOptions[256] = {'\0'};


/****************************************************************************
**
Expand Down Expand Up @@ -1719,7 +1713,6 @@ struct optInfo options[] = {
{ 'M', "", toggle, &SyUseModule, 0}, /* must be handled in kernel */
{ 'X', "", toggle, &SyCheckCRCCompiledModule, 0}, /* must be handled in kernel */
{ 'R', "", unsetString, &SyRestoring, 0}, /* kernel */
{ 'U', "", storeString, SyCompileOptions, 1}, /* kernel */
{ 'a', "", storeMemory, &preAllocAmount, 1 }, /* kernel -- is this still useful */
{ 'e', "", toggle, &SyCTRD, 0 }, /* kernel */
{ 'f', "", forceLineEditing, (void *)2, 0 }, /* probably library now */
Expand Down
6 changes: 0 additions & 6 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,6 @@ extern Char SyCompileName[256];
*/
extern Char SyCompileOutput[GAP_PATH_MAX];

/****************************************************************************
**
*V SyCompileOptions . . . . . . . . . . . . . . . . . with these options
*/
extern Char SyCompileOptions[256];


/****************************************************************************
**
Expand Down

0 comments on commit bc0a0c5

Please sign in to comment.