Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80319 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-30 06:39:32


Author: jurko
Date: 2012-08-30 06:39:31 EDT (Thu, 30 Aug 2012)
New Revision: 80319
URL: http://svn.boost.org/trac/boost/changeset/80319

Log:
Replaced a goto based loop construct with a while loop in Boost Jam function.c module's expand() function to avoid a gcc 4.6.0 compiler optimizer bug on Linux (not reproducible using later GCC releases, and never reported on other OSs).

The bug was causing the inner while loop to be completely ignored, effectively causing concatenated Jam variable expansions to ignore all but the first variable value. For example, the following code:
  local a = one two ;
  ECHO /$(a)/ ;
would output '/one/' instead of '/one/ /two/'.

Kudos to Kim Rasmussen <rasmussen74 at gmail dot com> for detecting and helping debug & test the issue.
Text files modified:
   trunk/tools/build/v2/engine/function.c | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/engine/function.c
==============================================================================
--- trunk/tools/build/v2/engine/function.c (original)
+++ trunk/tools/build/v2/engine/function.c 2012-08-30 06:39:31 EDT (Thu, 30 Aug 2012)
@@ -1112,8 +1112,8 @@
     string_reserve( buf, size );
 
     i = 0;
+ while ( i >= 0 )
     {
- loop:
         for ( ; i < length; ++i )
         {
             items[ i ].size = buf->size;
@@ -1127,7 +1127,7 @@
             {
                 items[ i ].current = list_next( items[ i ].current );
                 string_truncate( buf, items[ i ].size );
- goto loop;
+ break;
             }
             else
                 items[ i ].current = list_begin( items[ i ].values );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk