<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/bugzilla.dtd">

<bugzilla version="4.0.10"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>5523</bug_id>
          
          <creation_ts>2007-12-27 19:25:00 +0000</creation_ts>
          <short_desc>Confusing warning: &quot;expression dangerous with linker stubs&quot;</short_desc>
          <delta_ts>2008-05-30 14:20:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>binutils</product>
          <component>gas</component>
          <version>2.18</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joerg Wunsch">j</reporter>
          <assigned_to>unassigned</assigned_to>
          <cc>bug-binutils</cc>
    
    <cc>eric.weddington</cc>
          <cf_gcchost></cf_gcchost>
          <cf_gcctarget>avr-*-*</cf_gcctarget>
          <cf_gccbuild></cf_gccbuild>
          

      

      

      

          <long_desc isprivate="0">
            <commentid>20827</commentid>
            <who name="Joerg Wunsch">j</who>
            <bug_when>2007-12-27 19:25:58 +0000</bug_when>
            <thetext>This warning is emitted in line 648 of file gas/config/tc-avr.c.

This warning has been confusing a lot of users in the past, because it is
ultimately generated for legitimate assembly code generated by GCC as
part of jump tables resulting out of a larger switch statement.

Discussion with the author of the atmega256x patch, Björn Haase, resulted
in an agreement that the warning should just be removed.  There is indeed
a minimal danger that a switch statement could cross an 128 KiB boundary
where a linker stub could suddenly be placed within the table, but as the
assembler cannot reliably detect this situation at all, it confuses more
people with legitimate code (not crossing a 128 KiB boundary) than it
would be really able to help out those who are in danger.  In the end, the
users are told to ignore the warning, so it doesn&apos;t do any good at all.  In
addition, Björn pointed out that it could only detect part of the problem
but is not able to cover all possible dangerous cases, because some code
might hide dangerous operations between other assembly code that is not
covered by the warning.

If at all, this warning needs to be emitted by GCC itself whenever it
generates the possibly dangerous code.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>20915</commentid>
              <attachid>2177</attachid>
            <who name="Nick Clifton">nickc</who>
            <bug_when>2008-01-07 16:44:10 +0000</bug_when>
            <thetext>Created attachment 2177
Remove the warning</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>20916</commentid>
            <who name="Nick Clifton">nickc</who>
            <bug_when>2008-01-07 16:45:46 +0000</bug_when>
            <thetext>Hi Joerg,

  Please could you try out the uploaded patch and let me know if it resolves the
problem for you ?

  Also - would it be possible for you to supply a small assembler source file
that demonstrates this problem ?  This could be turned in a gas test case to
make sure that the problem remains fixed.

Cheers
  Nick
 </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23788</commentid>
            <who name="Andy Hutchinson">hutchinsonandy</who>
            <bug_when>2008-05-29 22:38:12 +0000</bug_when>
            <thetext>I applied this patch to Binutils-2.18.50

I ran full avr gcc testsuite and there were no regressions. Importantly, it
removed all the failures caused by the warning message removed by this patch.

So its get my vote!

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>23796</commentid>
            <who name="Nick Clifton">nickc</who>
            <bug_when>2008-05-30 14:20:41 +0000</bug_when>
            <thetext>Hi Guys,

  I have checked the patch in.

Cheers
  Nick

gas/ChangeLog
	PR 5523
	* config/tc-avr.c (avr_ldi_expression): Do not warn about unknown
	relocs here.
</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
              isurl="0"
          >
            <attachid>2177</attachid>
            <date>2008-01-07 16:44:00 +0000</date>
            <delta_ts>2008-01-07 16:44:10 +0000</delta_ts>
            <desc>Remove the warning</desc>
            <filename>pr5523.tc-avr.c.patch</filename>
            <type>text/plain</type>
            <size>746</size>
            <attacher>nickc</attacher>
            
              <data encoding="base64">SW5kZXg6IGdhcy9jb25maWcvdGMtYXZyLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2cy9zcmMv
c3JjL2dhcy9jb25maWcvdGMtYXZyLmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNDgKZGlmZiAt
YyAtMyAtcCAtcjEuNDggdGMtYXZyLmMKKioqIGdhcy9jb25maWcvdGMtYXZyLmMJMTYgTm92IDIw
MDcgMTc6Mzk6MjIgLTAwMDAJMS40OAotLS0gZ2FzL2NvbmZpZy90Yy1hdnIuYwk3IEphbiAyMDA4
IDE2OjQzOjMwIC0wMDAwCioqKioqKioqKioqKioqKiBhdnJfbGRpX2V4cHJlc3Npb24gKGV4cHJl
c3Npb25TICpleHApCioqKiA2MTgsNjI0ICoqKioKICAJCSAgICAgIGJyZWFrOwogIAogIAkJICAg
IGRlZmF1bHQ6CiEgCQkgICAgICBhc193YXJuIChfKCJleHByZXNzaW9uIGRhbmdlcm91cyB3aXRo
IGxpbmtlciBzdHVicyIpKTsKICAJCSAgICB9CiAgCQl9CiAgCSAgICAgIHJldHVybiByZWxvY190
b19yZXR1cm47Ci0tLSA2MTgsNjI2IC0tLS0KICAJCSAgICAgIGJyZWFrOwogIAogIAkJICAgIGRl
ZmF1bHQ6CiEgCQkgICAgICAvKiBQUiA1NTIzOiBEbyBub3QgZ2VuZXJhdGUgYSB3YXJuaW5nIGhl
cmUsCiEgCQkJIGxlZ2l0aW1hdGUgY29kZSBjYW4gdHJpZ2dlciB0aGlzIGNhc2UuICAqLwohIAkJ
ICAgICAgYnJlYWs7CiAgCQkgICAgfQogIAkJfQogIAkgICAgICByZXR1cm4gcmVsb2NfdG9fcmV0
dXJuOwo=
</data>

          </attachment>
      

    </bug>

</bugzilla>