From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3028 invoked by alias); 22 Apr 2004 17:20:51 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3018 invoked by uid 48); 22 Apr 2004 17:20:50 -0000 Date: Thu, 22 Apr 2004 17:35:00 -0000 Message-ID: <20040422172050.3017.qmail@sources.redhat.com> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040410182243.14911.monge@sns.it> References: <20040410182243.14911.monge@sns.it> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/14911] static const symbols lost when referred in asm X-Bugzilla-Reason: CC X-SW-Source: 2004-04/txt/msg02033.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-22 17:20 ------- Just to let you know that I hear that mplayer has not accepted a patch to fix this yet, here is a way to use the attribute for both 3.4.0 and above and 2.95.3: #define ATTRIBUTE_USED #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >=4) #undef ATTRIBUTE_USED #define ATTRIBUTE_USED __attribute__((used)) #endif static const int hello ATTRIBUTE_USED = 56; int main() { asm( "mov hello, %eax\n" ); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14911